I am struggling with MVC4 and JQuery validation.
We have a decent number of textboxes with their validation message next to them.
Once they have entered valid messages in all of them the messages all go away. but when I do:
var valid = $('form').valid();
it will always return false. got this from (How to fire jQuery function only if form is valid)
I have no idea what is still wrong with the form. Is there a way of getting the error messages for the form?
I have tried hooking up the show errors on the validate() such as described here:
Jquery validate showerrors display name
but this never populates any information. As I test I put this on the change of every input box:
if ($('form').valid()) {
alert('the form is valid');
}
else if(!$('form').valid()) {
alert('the form is NOT valid');
}
but it will always return NOT valid.
EDIT
Was just going about to create the online sample (as requested by webdeveloper). Chrome was hiding some of my HTML (using jquery tab control). So went to IE to get the source and the validation worked. Then tried it in FF and it worked. So it seems it is only broken in Chrome.
EDIT 2
Created the jsfiddle.net page: http://jsfiddle.net/qN3Cn/1/
In IE the form will return valid, in chrome it is not valid.