Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Antoine Bergeron 18 posts 107 karma points
    Sep 06, 2017 @ 15:04
    Antoine Bergeron
    0

    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.

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Sep 06, 2017 @ 16:21
    Ismail Mayat
    0

    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

  • Antoine Bergeron 18 posts 107 karma points
    Sep 06, 2017 @ 16:29
    Antoine Bergeron
    0

    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!

Please Sign in or register to post replies

Write your reply to:

Draft