Re: Update form objects before submit

From: Date: Wed, 29 Aug 2001 09:16:17 +0000
Subject: Re: Update form objects before submit
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-64965@lists.php.net to get a copy of this message
<Original message> From: Stephane Pinel <spinel@noos.fr> Date: Wed, Aug 29, 2001 at 11:08:45AM +0200 Message-ID: <B7B27DBD.9F3A%spinel@noos.fr> Subject: [PHP] Update form objects before submit > I have a html page including php scripts that perform different stuff. > The page contains a form (a Select 'products-price' and a field 'qty'). > Depending the choice made by the user, I need to know what item in the > SELECT object was choose and the number entered in the 'Qty' field to > initialized a 'subtotal' zone BEFORE the user submit the form. > This functionality is common to all e-business sites when you have to clic > on the 'update' button before submit the form. > > Any idea ? > > thanks > > ---------------------------------- > Stéphane Pinel > 39, Rue du Docteur Heulin > 75017 Paris (FRANCE) > 33 1 53 11 05 77 > 33 6 08 94 63 16 > spinel@noos.fr > ---------------------------------- > > > -- > 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 </Original message> <Reply> You'll need to use JS... Eg: --- HTML example --- <HTML> <BODY> <FORM name="frm"> <SELECT name="mySel"> <OPTION value="25">Blah 1</OPTION> <OPTION value="5">Blah 2</OPTION> <OPTION value="83">Blah 3</OPTION> <OPTION value="2">Blah 4</OPTION> </SELECT> <INPUT type="button" value="Update" onclick="void(someUpdateFunc());"> </FORM> </BODY> <SCRIPT type="text/javascript"> function someUpdateFunc () { var selValue = document.frm.mySel.options[document.frm.mySel.selectedIndex].value; alert ("You selected: "+selValue); } </SCRIPT> </HTML> --- End of HTML example --- This will show you what you need (I hope)... </Reply> -- * R&zE: -- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze@datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««

« previous php.general (#64965) next »