RE: [PHP-DB] sending hidden values
| From: | John Holmes | Date: | Mon, 23 Sep 2002 11:05:01 +0000 |
| Subject: | RE: [PHP-DB] sending hidden values | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-21929@lists.php.net to get a copy of this message | ||
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:smitamanohar@hotmail.com]
> Sent: Monday, September 23, 2002 6:31 AM
> To: php-db@lists.php.net
> 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