Re: forms question
| From: | 1LT John W. Holmes | Date: | Tue, 25 Jun 2002 19:10:34 +0000 |
| Subject: | Re: forms question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-103823@lists.php.net to get a copy of this message | ||
> I'm busy with an order form in php. How would I display a text field only
> if a checkbox is checked. The reason for this is that if the user selects
> the product in the form and, how would I get to display the quantity field
> corresponding to that checkbox
if(isset($_REQUEST['checkbox_name']))
{ echo "<textarea>Data</textarea>"; }
etc...
Adapt to your needs. remember that PHP runs on the server, so what you want
to happen won't work unless the form is submitted in between. i.e. check the
checkbox, submit the form, now it shows/doesn't show a text area depending
on the whether the checkbox was checked or not.
---John Holmes...