Reply to Re: Using a <SELECT> field on a Form

Your name:

Reply:


Posted by Michael Fesser on 01/02/08 05:44

..oO(Alan M Dunsmuir)

>I have a Form with a <SELECT> tab, its <OPTION> tabs generated by
>records in a database table using PHP5 and a 'SELECT' query.
>
>The values displayed are chosen to be recognisable to the users (they
>are in fact a list of names), but the data I need to process in the
>post-back come from other related fields in the same database record.

If these records are identified by a number for example, assign them to
the 'value' attribute of your select options:

<select name="foo">
<option value="1">first name</option>
<option value="2">second name</option>
...
</select>

After submit, you can find the number of the chosen option in
$_POST['foo'] or $_GET['foo'].

Micha

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация