Form validation: form scroll to the problematic fields upon submit

  • 8 April 2015
  • 1 reply
  • 11 views

Badge +2

Hi All, I know in K2 SmartForm we can do form validation where it will show "red" highlighted control whenever the validation is not fulfill. Or, we can have a pop up message box listing all problematic fields. But, does anyone know how to scroll the form to the problematic fields upon submission? Because sometimes, the form can be very long, and it takes time to find the "red" highlighted problematic fields. Please advice. Thank you.


1 reply

Badge +10

Hi AT,

 

The possible solution I'm thinking of is a bit tricky, but may be possible depending on your form.

 

Essentially, you'd want to transfer some javascript/jquery to a data label object on the form as part of the "failure condition", and use something similar to this:

http://stackoverflow.com/questions/6677035/jquery-scroll-to-element

Regards,

 

Mike

Reply