What are you trying to do? Don't you want the value in the <option> part...not in a hidden field?
<option value="whatever">Display This</option> Then "whatever" will be passed as the value of the $select box. Are you trying to do something else? If so, create your <input type="hidden" string instead of echoing it out within the loop. $hidden .= "<input type='hidden' ... Then echo out $hidden _after_ </select> ---John Holmes... > -----Original Message----- > From: Smita Manohar [mailto:[EMAIL PROTECTED]] > Sent: Monday, September 23, 2002 6:31 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] sending hidden values > > hi all, > in my php script im using <SELECT> in <FORM> element. > the <OPTION> values for <SELECT> tag are coming from database. and the > situation in my code is that, those values i need to pass as a hidden > value > thru form. > > im doing it as, > <FORM method="post" action="act_modify.php"> > . > . > . > <SELECT NAME="item_v"> > // some stuff before this to build query > <? > $result = mysql_query($query) or die ("SELECT failed."); > while ($list = mysql_fetch_array($result)) > { > > print('<INPUT type ="hidden" name=item_array[] value=' > ".$list[item_id]." '>'); > > echo ' > <OPTION> > $list[item_id] > </OPTION> '; > } > echo '</SELECT> '; > ?> > . > . > . > </FORM> > > <SELECT> works fine without the "<input type=hidden>" stuff. but when i > use > > print('<INPUT type ="hidden" name=item_array[] value=' ".$list[item_id]." > '>'); > > statement in betn <select> </select> tags, it doesn't print the values > betn > <option> </option> tag in list box, (ie $list[item_id]) instead it prints > one empty list box and $list[item_id] value beside that box. > > can any one suggest some other possible way to do this? > thanks in advance. > smita. > > > > _________________________________________________________________ > Chat with friends online, try MSN Messenger: http://messenger.msn.com > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php