I have several form fields that require a number. The jQuery validator plugin has a number rule that does not except numbers that start with a decimal point; they must start with zero. I found this code which allows the number rule to accept numbers without a leading zero.
My problem is, I still need a leading zero added to the number before I attempt to insert it into the database. How would I go about adding a leading zero (on the blur event) to those fields that start with a decimal point? I'd like to do it within the above method so I don't have to bind a function to the blur event on every single number field.
"There is no reason for any individual to have a computer in his home" ~ Ken Olson, Co-founder of DEC, 1977
Yes, I'll be checking that in the validation class that's next on the list, but I'd like to modify the input fields for the sake of "user experience". It's not critical to the app, but it's something that I'd like to learn.