h5Validate icon indicating copy to clipboard operation
h5Validate copied to clipboard

Long form, scroll to error?

Open sporkman opened this issue 10 years ago • 1 comments

I'm very much a JS noob. I have the validation working, and I love the idea of this project - basically make the browser act like it truly supports html5 validation. :)

I have a very long form, that even on an iPad has form items out of view when hitting "submit". Is there a simple way to have the browser scroll up to where the first error exists?

sporkman avatar Nov 04 '15 22:11 sporkman

Sure. You can listen for the formValidated event and scroll to the first element with an error. There is a jQuery plugin that will let you scroll to a selected element.

ericelliott avatar Nov 04 '15 22:11 ericelliott