unsider Posted April 6, 2008 Share Posted April 6, 2008 Suprisingly this is the first time I'm working with <select> tags, and the data just so happens to be 'gender'. With the option of selecting 2 values. "Male", "Female". Well I need to take this information and write it to my database. There is already a connection to my database, and everything is functional, I'm just not sure how I'm not sure of the syntax. DB = mtlc?old table = 'users' feild = 'gender' This is all strictly input, I will be outputting the data elsewhere. <table> <tr> <td>Gender:</td> <td><select class="select" name="gender" id="gender" value=" <?php if($form->value("gender") == ""){ echo $session->userinfo['gender']; }else{ echo $form->value("gender"); } ?>"> <option value="-1">Gender:</option> <option value="1">Female</option> <option value="2">Male</option> </select> </td></tr> <tr> <td>Gender:</td> <td><input type="text" name="gender" value=" </td> <td><?php echo $form->error("gender"); ?></td> </tr> </table> Thanks, if anyone can help. Quote Link to comment Share on other sites More sharing options...
CreactiveOnline Posted April 6, 2008 Share Posted April 6, 2008 Well first of all there are two things I see with your code that I dont think are right (though i'm not positive...) First.. I've never seen the select tag have an actual "value" to it... Only the option tags.. Second of all... <td><input type="text" name="gender" value=" </td> One - it's not closed out.. Two... The textarea AND the select both have the same name? Never seen that either.. 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.