Jump to content
  • Advertisement
Sign in to follow this  
Tac-Tics

[web] Setting SELECT default choice

This topic is 4515 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If I have a script wih a SELECT-style dropdown menu and the user enters, let's say, an invalid e-mail address, and hits submit, I want to return back to the script with each field displaying what the user had entered previously. I can do this for text forms easily with value="<?php if isset(...), echo ...; ?>", but how do I do this with a SELECT/OPTION combo?

Share this post


Link to post
Share on other sites
Advertisement
Newer browsers will require you to set the default selected tag as follows:


<select>
<option selected="selected">stuff</option>
</select>

Share this post


Link to post
Share on other sites
Quote:
Original post by Tesseract
Newer browsers will require you to set the default selected tag as follows:


<select>
<option selected="selected">stuff</option>
</select>


Not newer browsers, newer doctypes. Namely xhtml.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!