I have a form with some input fields:
Folder Name:
<input type="text" id="folderName" name="folderName" data-bind = "value: FolderName" />
Prefix:
<input id="prefix" name="prefix" data-bind = "value: Prefix" />
I validate those fields using jquery validation plugin:
rules: {
folderName: {
required: true
},
prefix: {
required: true,
exactLength: 4
},
}
When submitting the form with empty fields, error messages are displayed for both inputs. What I want to accomplish is the first element with error message to go on focus. My skills in javascript are rather poor so any working example will be greatly appreciated. Thank You!
drop something like this after your validation fires