sandhya Posted February 27, 2008 Share Posted February 27, 2008 Id like to load a drop down list from a mysql database and i did it. But that selected value is not passing to the next form. Anyone can help me please? Quote Link to comment Share on other sites More sharing options...
timmy0320 Posted February 27, 2008 Share Posted February 27, 2008 Did you view the source to make sure the value's were posting correctly? Quote Link to comment Share on other sites More sharing options...
sandhya Posted February 27, 2008 Author Share Posted February 27, 2008 ya i'm giving the code i used here. <select name="empid" > <option value="" selected>Select Empolyee ID</option> <?php while ($recs = mysql_fetch_array($empids)){ $id = $recs['id']; ?> <option value="<? $id ?>"> <? echo $id; ?></option> <? } // end while ?> </select> on submitting this form the value passed is the last row of the selection evry time. Quote Link to comment Share on other sites More sharing options...
cyrixware Posted February 27, 2008 Share Posted February 27, 2008 can you please post here in the drop down list part? Quote Link to comment Share on other sites More sharing options...
cyrixware Posted February 27, 2008 Share Posted February 27, 2008 <select name="empid" > <option value="selected">Select Empolyee ID</option> <? while ($recs = mysql_fetch_array($empids)){ // $id = $recs['id']; ?> <option value="<?=$recs['id']; ?>"> <?=$recs['id'];?></option> <? } // end while ?> </select> take note also in this part: <option value="" selected>Select Empolyee ID</option> Quote Link to comment Share on other sites More sharing options...
sandhya Posted February 27, 2008 Author Share Posted February 27, 2008 thanks. its worked. 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.