Question

Thanks for taking the time to read this, my question is in regards to how jquery does the validation errors, I've noticed that if I put in code like so:

$("#MainForm").validate();

When the error is raised on submit, and it pops up a nice box with an arrow pointing to the field in question. simple validation

When I use the following code:

    $(document).ready(function() 
    {
    $("#MainForm").validate();
    });

when I put it into the ready function

I only get text saying that the field is required, instead of the nice little pop-up box.
I noticed this when I started adding rules, and frankly I would prefer the original popup, is there a way to tell jquery validation to use that method, instead of the text fields like in the second example?

Thank you for your time,

Was it helpful?

Solution

The pop up nice box is generated by Internet Explorer, and not by jQuery Validation, when you add required attribute. jQuery Validation is not binded yet to your input element. Try to remove $("#MainForm").validate(); , reload page, and re-submit your form. The result will be the pop up nice box.

As far as I know, the only way to tell jQuery Validation to use that method is by customize css files used within jQuery Validation plugin.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top