I want that screenCheck function show run only after Validation of #contact_email. But in my case its running before that. how do I correct it?
<script>
function screenCheck() {
var screenWidth = window.screen.width;
if (screenWidth == '1024') {
$('#textAreaMsg label.error').css('margin-left', '99px');
}
}
$(document).ready(function() {
$("#contact_email").validate(screenCkeck());
</script>
Assuming you’re using the JQuery validator plugin, you need to pass the callback as part of the options map. For example, to make your callback run after the form has been deemed invalid, you’d write it like this:
The same goes for the submitHandler and/or the showErrors handler. To handle all three, you’d write it like this: