Recently I was playing with jQuery form validation, and I ran into a problem.
I wanted to customize the error message accoring to the form element, when a validation error occures.
For example, I can’t give the same error message to a text field, and a select dropdown list. Even in English you’d print out ‘Please, fill in the form’, and ‘Please, select from the list’ or something like that.
I wanted to do the switch between these to formulas, by detecting the input forms node name.
Why is in DOM simply nodeName, but if you try it with jQuery it would say undefined:
The solution is so over here: