Re: [PHP] Update form objects before submit From: * R&zE: (renze <email protected>)
Date: 08/29/01

<Original message>
From: Stephane Pinel <spinel <email protected>>
Date: Wed, Aug 29, 2001 at 11:08:45AM +0200
Message-ID: <B7B27DBD.9F3A%spinel <email protected>>
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 <email protected>
> ----------------------------------
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe <email protected>
> For additional commands, e-mail: php-general-help <email protected>
> To contact the list administrators, e-mail: php-list-admin <email protected>

</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 <email protected> -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>