On 31 Mar 2001 22:03:54 -0800, Sean Weissensee <[EMAIL PROTECTED]> wrote:
>I have a shopping cart system I wrote which display several detail lines
>of items purchased, at the moment if the user changes a quantity they have
>to manualy
>click a link to recalulate the total, I would like this to happen as soon as
>the
>user tabs of the qty field.

Use an OnBlur() handler and some JavaScript. However, you'll still need to do
the calculations on the server to prevent cheating because if you want to
support older browsers, you'll need to put the total in an <INPUT TYPE="TEXT"
field. Your PHP code could generate a JavaScript function ("recalc()") that
would check each item and a cost * quantity to update the subtotal; when they
hit submit, you'd need to do the same check in PHP to be sure of getting an
accurate result.

-- 
PHP General 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