There is focusInvalid option, which is true by default. But it works only when form submission happens. If I validate the form with valid method, then it doesn’t work. So the question is how to focus invalid field when valid is used?
Please see this demo to see the difference. Just press buttons there.
First of all you need to save your validator to a variable so you can use it in the click handler:
Then in the validate handler, you can manually call the
focusInvalidfunction from thevalidatorvariable:Example