Forum Moderators: open

Message Too Old, No Replies

sending a variable onchange

how do i send a variable onChange of a text field

         

bono

2:55 pm on Jul 25, 2005 (gmt 0)

10+ Year Member



Hey guys im looking for a way to send a variable on the change of a input text field eg

user changed qty of widgets text field from 2 to 4 widgets.

I want the page to reload and 2 variables to be sent. the value of 4 and also the widgetID. I know I can do this with a submit button but this would not be very user friendly.

Dijkgraaf

5:01 am on Jul 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can always put onchange="submit();" on the field so it auto submits.

RonPK

8:42 am on Jul 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I find onchange in text fields a bit awkward, as the event only fires when the user leaves the field, e.g. by clicking outside the field. It may take users by surprise.

If the purpose is to merely re-calculate a price, I'd prefer to do that client side, without submitting the form.

Stooshie

8:31 am on Jul 27, 2005 (gmt 0)

10+ Year Member



try the onKeyup (or onKeyDown).

I prefer the onKeyUp as you can check for invalid key presses.

Best regards,

Andrew.