Need help looping through form input fields
Started by Lee W, Apr 11 2012 07:32 AM
2 replies to this topic
#1
Posted 11 April 2012 - 07:32 AM
Good morning,
I have a small problem that's driving me nuts because i'm pretty new to Javascript.
I want to loop through a selected number of inputfields in a form which all have a class of 'quantity'.
When an 'onblur' event happens on each particular input field i want it to display whether the input was a valid number or not next to the field in a span class.
Any idea's or solutions would be appreciated.
Regards,
Lee.
I have a small problem that's driving me nuts because i'm pretty new to Javascript.
I want to loop through a selected number of inputfields in a form which all have a class of 'quantity'.
When an 'onblur' event happens on each particular input field i want it to display whether the input was a valid number or not next to the field in a span class.
Any idea's or solutions would be appreciated.
Regards,
Lee.
#2
Posted 11 April 2012 - 08:06 AM
Good morning,
I have a small problem that's driving me nuts because i'm pretty new to Javascript.
I want to loop through a selected number of inputfields in a form which all have a class of 'quantity'.
When an 'onblur' event happens on each particular input field i want it to display whether the input was a valid number or not next to the field in a span class.
Any idea's or solutions would be appreciated.
Regards,
Lee.
It sounds to me like you're looking for a validation plugin. This one I use and should do the trick. As far as I'm aware though, it loops by the name tag, not the class tag, but you could still use it.
http://bassistance.d...gin-validation/
#3
Posted 11 April 2012 - 08:27 AM
That's great Mike thanks very much but i would be interested to know the Javascript way because the reason i am developing this form is to sharpen up my javascript & to gain a better understanding of it.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users














