I am using jQuery Validate and trying to move (or scroll) at the top of the page when an error is detected. I added the focusInvalid parameter to stop focusing on the error field, but I canโt figure out how to go to the beginning (like at the top of the page, my error container is displayed).
Below is a simplified version of my script and thanks for any help with this.
$(".event-form").validate({
errorContainer: ".error-container",
errorLabelContainer: ".error-container ul",
wrapper: "li",
focusInvalid: false,
ignore: "",
rules: {
title: { required: true }
},
messages: {
title: "You must enter the title"
}
});
source
share