You can do it either way.

You can either have the user change values, then hit the "recalculate" or 
"update" button which calls the PHP script to update all values.. or you 
can use JavaScript to update some simple calculations immediately after the 
user makes any changes, but you still need to have them eventually submit 
it to actually record the changes anywhere meaningful -- i/e database, 
file, session/cookie, etc.

A nice combination of both is the most aesthetic.  For example, say you had 
a form with 3 inputs:
[item price]   [quantity]    [subtotal]
It would be nice to have the JavaScript update subtotal any time the user 
changes the item and/or quantity, to reflect the new subtotal.  But you 
would still need them to submit the form for PHP to take note of the 
submitted data and do whatever.

-Mike

At 07:55 AM 5/19/01 -0500, you wrote:
>This is what my screen looks like:
>
>                                   I want to order ...
>description     image    dropdown box              @ 7.95 each = [text box]
>                                   containing 0-20
>                                   numerics
>
>I had been contemplating using Javascript to perform the text box 
>extension of the quantity * rate calculation. However, the
>need is to also update a MySQL table with the session tracking number and 
>other pertinent information about the selection
>so a purchase order can be written in a subsequent module.
>
>Can this be done with straight PHP or will it require a mix of Javascript 
>for the calculation and PHP for the data base update?
>If so, what might the code look like?
>
>Bob
>
>
>--
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


               -=- Mike Flynn - Burlington, VT -=-
[EMAIL PROTECTED]  http://www.mikeflynn.net/  * Give blood *
  Wouldn't the free market, in its true form, be anarchy?


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to