I am validating an HTML using knockout-validation, I need to focus the cursor on the first control having error how could I do that?
Please help..
Thanks
Make sure you are setting an error class for your elements in the data-bind
attrbute of all elements being validated:
data-bind = " ...
validationOptions: { errorElementClass: 'input-validation-error' }
... "
Then at the point of validation you can get all of these elements with jquery and just apply focus to the first one:
$(".input-validation-error").first().focus();