Web Design Forum: i want my dropdown to always select the value from database as defualt. - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

i want my dropdown to always select the value from database as defualt. Rate Topic: -----

#1 User is offline   adsegzy 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 60
  • Joined: 15-February 10
  • Reputation: 1

Posted 10 March 2010 - 04:54 PM

Hello guys, from my sign up form i make my sex field which is dropdown, which options are SELECT YOUR SEX, MALE, FEMALE. In my edit profile page i also have the sex field as dropdown but i want it to always echo or show the value in the database. as in if the member has signup as a female whenever she visit her edit-profile page the dropdown should show FEMALE which is in the database of the member as her sex and not SELECT YOUR SEX. kindly help

regards
0

#2 User is offline   TopShopper 

  • Expert
  • PipPipPipPip
  • Group: Members
  • Posts: 878
  • Joined: 21-July 09
  • Reputation: 14
  • Gender:Male
  • Location:Cardiff, UK
  • Experience:Intermediate
  • Area of Expertise:Coder

Posted 10 March 2010 - 04:59 PM

<select name="LangUse"  id="LangUse">
            	<option value="<?php print $LangUse?>" selected><?php print $LangUse?></option>
            	<option value="Cart">Cart</option>
            	<option value="Basket">Basket</option>
            	<option value="Trolley">Trolley</option>
          	</select>


Get the value from the data base then construct as above.
1

#3 User is offline   adsegzy 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 60
  • Joined: 15-February 10
  • Reputation: 1

Posted 10 March 2010 - 08:52 PM

View PostTopShopper, on 10 March 2010 - 04:59 PM, said:

<select name="LangUse"  id="LangUse">
            	<option value="<?php print $LangUse?>" selected><?php print $LangUse?></option>
            	<option value="Cart">Cart</option>
            	<option value="Basket">Basket</option>
            	<option value="Trolley">Trolley</option>
          	</select>


Get the value from the data base then construct as above.


topshoper thanks for your help. i really appreciate

regards
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users