I have a form that asks the user to enter his country...What I want to know is how to remember the user's country selection if he was returned back to the registration page due to an error he made during the registration in a different field without asking him again to select his country. <p> Country: <select name="Country"> <option value="" selected="selected">Select Country</option> <option value="whatever1">whatever1</option> <option value="whatever2">whatever2</option> <option value="whatever3">whatever3</option> <option value="whatever4">whatever4</option> </select> Code (markup): I use the following code to do the same thing when it's a text field but I don't know how to do it when it's a selection field. value="<?php if(isset($trimmed['whatever'])) echo $trimmed['whatever']; ?>" /> Code (markup): any ideas ?
<option value="<?php echo "$_REQUEST['seleted_coun_val"]; ?>" selected="selected"><?php echo "$_REQUEST['seleted_coun_val']; ?></option>
Thank you..it did work but needed a small syntax correction. value="<?php echo $_REQUEST['whatever'] ?>" selected="selected"><?php echo $_REQUEST['whatever']; ?></option> Code (markup):