Copied to clipboard

Flag this post as spam?

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


  • Rowena Bellamy 17 posts 118 karma points
    Sep 17, 2020 @ 15:31
    Rowena Bellamy
    0

    Umbraco forms - previous button doesn't go back

    Hi guys - I'm sure I'm missing something obvious here, but the Previous and Next buttons on my multipage forms both just take you forward (or on the last page, submit the form!). Any suggestions very welcome. Thank you! Rowena

  • Jordan Clark 2 posts 71 karma points
    Oct 22, 2020 @ 20:13
    Jordan Clark
    0

    Having the same issue

  • Jordan Clark 2 posts 71 karma points
    Oct 23, 2020 @ 15:00
    Jordan Clark
    0

    The previous button needs to value a value attribute. In Forms.cshtml add value="1" to the prev button and that should fix it.

  • Stefan Besteman 6 posts 26 karma points
    Aug 02, 2021 @ 12:36
    Stefan Besteman
    0

    value = 1 solution with required fields on the second page, doesn't work

  • Charlie Schmidt 1 post 21 karma points
    Oct 15, 2021 @ 04:14
    Charlie Schmidt
    0

    Same issue with Umbraco 8 and Forms - here is my fix:

        document.addEventListener("click", function (event) {
        if (event.target.name === "__prev") {
            var previousClickedElementName = "PreviousClicked";
            var previousClickedElement = document.getElementsByName(previousClickedElementName)[0];
            if (previousClickedElement !== null) {
                if (previousClickedElement.value === "") {
                    event.preventDefault();
                    previousClickedElement.value = "1";
                    var form = previousClickedElement.parentNode;
                    form.submit();
                }
            }
        }
    }, false);
    
Please Sign in or register to post replies

Write your reply to:

Draft