Copied to clipboard

Flag this post as spam?

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


  • Christian Palm 276 posts 271 karma points
    Sep 30, 2010 @ 15:15
    Christian Palm
    0

    Hooking into javascript validation

    Hi

    I would like to hook into the javascript validation. The problem is when you have a really long form and you have a scrollbar and you are scrolled down to the bottom of the page and click submit. If you have a validation error in the top of the page you won't notice the error and the user can not understand why the will not submit.

    Therefore I will hook into the validation and do scrollToError or just throw an alert box.

    Does anybody have any pointers on how to achieve this?

  • bob baty-barr 1180 posts 1294 karma points MVP
    Sep 30, 2010 @ 22:32
  • Probocop 51 posts 71 karma points
    Oct 01, 2010 @ 13:49
    Probocop
    0

    I prefer to use the jQuery Form Validation plugin as it offers a great amount of options with regards to showing messages, message placement etc

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Oct 04, 2010 @ 09:16
    Tim Geyssens
    0

    Hi Christian,

    Try this http://forums.asp.net/t/1126420.aspx

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Oct 04, 2010 @ 09:22
    Tim Geyssens
    0

    Just make sure to set the correct validation group, should be set to the clientid so <%= this.ClientId %> should do it

  • Christian Palm 276 posts 271 karma points
    Oct 05, 2010 @ 11:47
    Christian Palm
    0

    Thanks for all the answers after some more google around I found this http://forums.asp.net/t/1089469.aspx

    It was super simple and resolve my needs SetFocusOnError="true"

    In /usercontrols/umbracoContour/RenderForm.ascx

    <uform:RequiredValidator ... SetFocusOnError="true" ... />
    <uform:RegexValidator ... SetFocusOnError="true" ... />

    Mayby it should be default in Contour

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Oct 05, 2010 @ 14:48
    Tim Geyssens
    0

    Nice, thanks for the update

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies