pouncer Posted January 22, 2007 Share Posted January 22, 2007 Here is how the drop down is<select name="sel_Gender" class="style15" id="sel_Gender"> <option value="Male" selected>Male</option> <option value="Female">Female</option> </select> It's on Male by default.but i need to put in there somewhere this:<?php echo $profile->Get_Gender(); ?> which gives either male/female, and how could i do it guys so it selects the apporpriate one correctly.thanks for any help Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 22, 2007 Share Posted January 22, 2007 <?php if($profile->Get_Gender() == 'male'){ $male = ' selected ';}else{ $female = ' selected ';}<select name="sel_Gender" class="style15" id="sel_Gender"> <option value="Male" <?=$male?>>Male</option> <option value="Female" <?=$female?>>Female</option></select> Quote Link to comment Share on other sites More sharing options...
pouncer Posted January 22, 2007 Author Share Posted January 22, 2007 perfect, thanks Quote Link to comment Share on other sites More sharing options...
ShogunWarrior Posted January 22, 2007 Share Posted January 22, 2007 jesi, I see still have notices off. ;) Quote Link to comment Share on other sites More sharing options...
boo_lolly Posted January 22, 2007 Share Posted January 22, 2007 slightly different than jesi's, but same concept:[code]<?php if($profile->Get_Gender() == "male"){ $male = " selected"; }else{ $male = ""; } if($profile->Get_Gender() == "female"){ $female = " selected"; }else{ $female = ""; } echo "<select name=\"sel_Gender\" class=\"style15\" id=\"sel_Gender\">\n". "<option value=\"Male\"". $male .">Male</option>\n". "<option value=\"Female\"". $female .">Female</option>\n". "</select>\n";?>[/code] Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 22, 2007 Share Posted January 22, 2007 [quote author=ShogunWarrior link=topic=123523.msg510658#msg510658 date=1169486157]jesi, I see still have notices off. ;)[/quote]If it ain't broke, don't fix it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.