Re: Newbie Question re: Select boxes
| From: | jimw at apache dot org | Date: | Thu, 23 Aug 2001 20:01:45 +0000 |
| Subject: | Re: Newbie Question re: Select boxes | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-64164@lists.php.net to get a copy of this message | ||
Lb <loydNOSPAM420@hotmail.com> wrote:
> 1) I thought that PHP automatically created variables for all form elements
> on a page. When I run this, the dropdown box contains the first item, but
> $Report evaluates as null. I am unclear why.
>
> <select name="Report"><BR>
> <option value=>1 Test Report A</option>
> <option value=>2 Test Report B</option>
> <option value=>3 Test Report C</option>
> </select>
> <? echo ("the value is $Report"); ?>
you have set the value for each option to an empty string. you
probably mean either '<option value="1">Test Report A</option>' or
'<option>1 Test Report A</option>'.
> 2) Is there any way for PHP to detect the change even on the dropdown, or do
> I need to use javascript?
you have to use javascript.
jim