Copied to clipboard

Flag this post as spam?

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


  • Sebastian Dammark 583 posts 1407 karma points
    May 10, 2016 @ 13:48
    Sebastian Dammark
    0

    Go to form location on submit

    When you submit a form and displays a message the page jumps to the top.

    Is it in any way possible to set the return URL to the following

    /#contour_form_@{@Model.FormName.Replace(" ", "")}
    

    This will make the browser jump to the DIV surrounding the form.

    I've been looking in the Form.cshtml, but the markup for the

    tag is put away in something I don't know much about :)

  • Ronald Barendse 39 posts 218 karma points hq c-trib
    Oct 24, 2017 @ 11:35
    Ronald Barendse
    0

    I had the same requirement and fixed it using jQuery (using Umbraco Forms 6):

    $('.umbraco-forms-form[id]:has(form)').each(function () {
        var umbForm = $(this), form = umbForm.find('form');
        form.attr('action', form.attr('action') + '#' + umbForm.attr('id'));
    });
    

    Make sure the id is set on both the form and submit message (<div id="[email protected]" class="...">).

Please Sign in or register to post replies

Write your reply to:

Draft