Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2005
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Drop Down Box Help

    Hello,

    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.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Selected

    Use your form handler script to serve up a slightly changed version of the form, with this attribute:
    Code:
    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)
    Regards,
    Ronald.
    ronaldvanderwijden.com


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •