After I hit the submit button on my forms, if there is an invalid field, I would like the page to focus on it and scroll up to its position.
I've seen suggestions, on here or stackoverflow, but when I tried the suggested method (not confirmed to work on Umbraco by the way), the code in the invalidHandler part is never hit. Is there something else in Forms that override that call maybe?
Any other suggestion on how to do something similar?
I did it a while back but not with umbraco forms. It was form handled by surfacecontroller and on submit with error i set temp data flag then on render tested for that and added hidden field. Then using jquery tested for that hidden field and then scrolled down.
Sadly, the rest of the form is already complete, with workflow and what not, and I have limited time to work on it. Can't rework it from scratch in the available debug time.
I'll keep it in mind for our next project though. Thanks!
How to scroll to invalid field on submit?
After I hit the submit button on my forms, if there is an invalid field, I would like the page to focus on it and scroll up to its position.
I've seen suggestions, on here or stackoverflow, but when I tried the suggested method (not confirmed to work on Umbraco by the way), the code in the invalidHandler part is never hit. Is there something else in Forms that override that call maybe?
Any other suggestion on how to do something similar?
I'm running Umbraco 7.5.13 with Forms 4.4.2.
Antoine,
I did it a while back but not with umbraco forms. It was form handled by surfacecontroller and on submit with error i set temp data flag then on render tested for that and added hidden field. Then using jquery tested for that hidden field and then scrolled down.
Regards
Ismail
Sadly, the rest of the form is already complete, with workflow and what not, and I have limited time to work on it. Can't rework it from scratch in the available debug time.
I'll keep it in mind for our next project though. Thanks!
is working on a reply...