View Full Version : Drop Down Box Help

02-17-2005, 12:46 PM

I am getting the user to select items from a drop down box, then it is being validated in a php script, if the validation fails, the form is redisplayed, BUT i can not make the item in the drop down box they user previously selected come up as the selected item.

Pls could someone note down the code i ned to make this possible, cheers.

02-17-2005, 01:09 PM
Use your form handler script to serve up a slightly changed version of the form, with this attribute:

selected="selected" added to the chosen option.
(The seemingly double specification might look silly, but this is the correct way for XHTML and doesn't hurt HTML)