Re: Option value
| From: | 1LT John W. Holmes | Date: | Wed, 16 Oct 2002 15:33:41 +0000 |
| Subject: | Re: Option value | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-120210@lists.php.net to get a copy of this message | ||
> Is it possible to extract the value option which item name selected..for
> example i am having list of soap brand in the options..is it possible that
> to tell that the user seleced this brand of soap while in the submittion
> of the form..can any one please tell me how to do this..
Umm...that's what PHP does, isn't it?
<form method="GET">
<select name="soap">
<option value="Dove">Dove</option>
<option value="Zest">Zest</option>
</select>
<input type="submit">
</form>
When that form is submitted, you'll have a variable $_GET['soap'] that'll be
equal to either "Zest" or "Dove", depending on what the user chose.
Maybe you are missing the value="" in your <option> tags?
---John Holmes...