Posts

Showing posts with the label jquery validation plugin

How to validate default values in a form ,- jquery validation plugin

I had a form which contained default values in the text boxes. ex: The first Name box has value 'Your Name' in it. But when onfocus, the text was cleared for user input. As I was using Jquery validation plugin i wanted to handle this scenario using jquery. Below is my question and the answer i came up with. http://stackoverflow.com/questions/2733922/jquery-validation-how-to-ignore-default-values-when-validating-mandatory-fields

jquery validation plugin and IE8 - 'jQuery.event.special.focusin' is null or not an object

I recently was using jquery validation plugin for form validation. It worked perfect on Firefox and Chrome. But when I tested on IE 8 , it did not work. The form submitted without any validation. using the inbuilt Javascript debugger for IE 8 (press F12 to activate it), I noticed the error 'jQuery.event.special.focusin' is null or not an object. I ran the sample that came with the jquery.validation plugin and it seemed to work on IE8 without any issues, the only thing I noticed was that the reference for jquery.js and the jquery.validation plugin were right below each other. So I did the same, I moved the jquery.js reference from master page to the page where the validation plugin was used and the validation worked fine! <script type="text/javascript" src="assets/scripts/jquery-1.2.6.min.js"></script> <script src="assets/scripts/jquery.validate.min.js" type="text/javascript"></script>