I got problem on fields with display:none ... I need that after click on submit form button the error message will appear even if the field to validate is in div with display:none setting. I find solution and try to add to the jQuery code setting
ignore: []
but this not change anything. Look at the div with class named 'moreurlinput', he got inline style display:none, but if you change this to display:inline (block,table etc.) the error of validation appear.
html
<form id="post" action="http://m.onet.pl" method="post" class="validatedForm">
<div class="moreurlinput" style="display:none">
<input class="moreurl center" type="text" name="moreurl" id="moreurl" />
</div>
<div>
<button type="submit" />Add</button>
</div>
</form>
jquery
jQuery('.validatedForm').validate({
errorElement: "div",
errorClass: 'validate-error',
rules: {
"moreurl": {
required: true
}
},
messages: {
moreurl: "Please define 'More' URL value"
}
});