Re: PHP/Javascript

From: Date: Sat, 19 May 2001 14:47:21 +0000
Subject: Re: PHP/Javascript
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-7755@lists.php.net to get a copy of this message
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: php-windows-unsubscribe@lists.php.net For additional commands, e-mail: php-windows-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
              -=- Mike Flynn - Burlington, VT -=-
mike@mikeflynn.net http://www.mikeflynn.net/ * Give blood * Wouldn't the free market, in its true form, be anarchy?

« previous php.windows (#7755) next »