I often use this jQuery validation plugin to validate forms and it works great. Really pleased with it, but when you press Submit on a form it automatically puts focus on the field that was invalid.
On my current project I have a form wich is really long, and when you press the submit button, your scroll jumps up to the field (probably because it gets focused), but when my form is this long i think it's a bit annoying. Does anyone know how i can disable jQuery validate from putting focus on invalid input fields.
Best regards!
Use the focusInvalid
option and set it to false
:
$("#abc").validate({
focusInvalid: false
});
Working example here and Documentation here (options tab)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With