Copied to clipboard

Flag this post as spam?

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

  • Tom Madden 253 posts 455 karma points MVP 4x c-trib
    Jul 21, 2017 @ 14:56
    Tom Madden

    Using custom JS file via Themes and changing validation to onblur

    This is more just an observation/comment than a question, so hopefully it might help someone in future. Apologies if it's covered elsewhere and I didn't find it.

    I had a need to change validation so that email addresses don't show as incorrect the minute you start typing, so I looked into it and found all I need to do was disable onkeyup, something like this:

            ignore: ":hidden",
            onkeyup: false

    So following the instructions on this page

    I copied the umbracoforms.js into my theme folder (making a new folder in App_Plugins/UmbracoForms/Assets/Themes so I didn't modify the default js file. (I love the new Theme mechanism).

    However, my js wasn't output, even though I changed the forms rendering script as instructed so it read:

    Html.RenderAction("RenderFormScripts", "UmbracoForms", new { formid = form, theme = "yourTheme" });

    It turn out that you also need to copy the Script.cstml in your Views Themes folder and change the path to the js because it's hard coded to look for the default theme js and not directly by specifying a theme parameter.

    Maybe I just wasn't reading the docs properly, or maybe it needs clarification.

    HTHS (hope this helps somebody)


  • Tom Madden 253 posts 455 karma points MVP 4x c-trib
    Jul 21, 2017 @ 15:39
    Tom Madden

    P.S. pull request now submitted for the documentation page.

Please Sign in or register to post replies

Write your reply to: