Re: HOWTO: Dynamically Create A Form
| From: | Renze Munnik | Date: | Wed, 04 Apr 2001 15:19:06 +0000 |
| Subject: | Re: HOWTO: Dynamically Create A Form | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-47073@lists.php.net to get a copy of this message | ||
Scott Walter wrote:
>
> I know this sounds very simple, but I only want certain fields on my form
> to be displayed depending on the selected item in a drop-down menu, that is
> part of the form. I cannot figure out how to get it to work, and I don't
> want to resubmit the form... *** I need it to be done on the fly.*** Your
> help is appreciated!
>
> Example of online form
> Source of Income: _________________
> Dues: _________________
> Type of Funds: ________________v
>
> Where ____ = text field
> ___v = drop-down menu
>
> Based on the selection of "Type of Funds" I want one more field to be
> displayed.
> pseudo-code:
> if (type_if_fund == 'Bank') {
> // then display text field to
> // enter the bank's name
> } else {
> // no need to display anything else
> }
>
> Thanks again.
>
> -Scott
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
Well; PHP is server-side, so without resubmitting the form you won't
be able to do this using PHP. That's why JavaScript is available. At
this time I don't have enough time to explain exactly how to do
this, but JS is the way for this.
If your in a hurry and noone else in this list _has_ got the time to
'finish' my msg, try posting a msg on a JavaScript newgroup.
E.g.:
secnews.netscape.com: netscape.devs-javascript
I'm sorry I can't help you out further at the time.
Good luck!
--
* R&zE:
***************************
** Renze Munnik
**
** E: renze@datalink.nl
** M: +31 6 218 111 43
***************************