4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Dropdown
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Kdawg
Senior WebHelper
Senior WebHelper


Joined: 21 Apr 2003
Posts: 153

PostPosted: Wed Jun 09, 2004 2:59 am (19 years, 10 months ago) Reply with QuoteBack to Top

If I have a dropdown menu and then I have someone select somthing and then put it in mysql, can I take it out and make the one they choose be selected?
Ex: Dropdown 1 Dropdown 2
-Choise 1 <-- This on is displayed first -Choise 3 <-- This one is dis
-Choise 2 -Choise 1 played first
-Choise 3 <--They choose this one and -Choise 2 because its
it gets put in a mysql db the one they
choose
OfflineView User's ProfileFind all posts by KdawgSend Personal Message
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Wed Jun 09, 2004 7:01 am (19 years, 10 months ago) Reply with QuoteBack to Top

You could use an if statement... where the variable $choice is the value you have pulled from the DB.

Code:
<select name="">
<option value="1"<? if($choice == 1) echo ' selected="selected"'; ?>Choice 1</option>
<option value="2"<? if($choice == 2) echo ' selected="selected"'; ?>Choice 2</option>
</select>
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.211002 seconds :: 19 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme