Re: javascript ?

From: Date: Tue, 24 Jul 2001 06:06:45 +0000
Subject: Re: javascript ?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-59301@lists.php.net to get a copy of this message
Only use hide(), show(), block(), etc. if you want an "ordinary" htmlpage to be shown. If you on the other hand want the values of form elements to change you should do something like this: <SCRIPT LANGUAGE="javascript"> function fillForm(){ document.form_name.txt.value = document.form_name.a_selection.value; } </SCRIPT> <FORM NAME="form_name" METHOD... ACTION....> <SELECT NAME="a_selection" onChange="fillForm();"> <OPTION VALUE="pickup">Pick up <OPTION VALUE="Goto">Go to </SELECT> <BR> <INPUT TYPE="text" NAME="txt" VALUE=""> <FORM> AB> I want to create a form which once you select a radio button or a drop down AB> menu display the proper fields according to the selection. AB> Let say that we have two options : To go and Pick Up. If the user select to AB> go then automatically display the address field, zip field etc, if the user AB> select pick up display the time field etc. Kind regards, Morten Winkler

« previous php.general (#59301) next »