Copied to clipboard

Flag this post as spam?

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


  • Dominic 21 posts 93 karma points
    Dec 15, 2015 @ 15:54
    Dominic
    0

    Umbraco Forms - SubmitHandled() always false

    Hi,

    We are unable to get the Success Message to display when a form is submitted. We have noticed that Model.SubmitHandled() in the Form.cshtml page is always equal to false. Therefore it never steps into the code that shows the success message.

    @if (Model.SubmitHandled)
    {
        if (Model.RenderMode == "full" || Model.RenderMode == "form")
        {
            <p class="contourMessageOnSubmit">@Html.Raw(Model.MessageOnSubmit)</p>
        }
    }
    else
    {
    // Display Form here
    }
    

    Oddly, this problem only occurs when the form is added as a macro via the RTE. If we manually add a form to a view, then it works as expected, i.e. SubmitHandled() is true and the success message does show when the form is submitted.

    We have also checked the source code to compare a form added via the RTE against one added directly added into a view and it appears identical, except for the hidden input field with name='ufprt' which has a different value.

    We are running....

    • Umbraco version: 7.2.8
    • Umbraco forms version: 4.1.4

    Can anyone think of anything that we could try to rectify the issue?

  • Jonas Havmøller 4 posts 24 karma points
    Mar 07, 2016 @ 08:27
    Jonas Havmøller
    0

    Did you find a solution for this? And did you make an issue on http://issues.umbraco.org/?

  • Ulla Skaanning 3 posts 82 karma points
    Jul 13, 2016 @ 10:15
    Ulla Skaanning
    0

    Did anyone find a solution to this problem? We are experiencing the same, but using Umbraco Forms 4.3.2. Any ideas would be much appreciated. :)

  • Kieran O'Dwyer 4 posts 74 karma points
    Dec 04, 2018 @ 14:10
    Kieran O'Dwyer
    0

    I know this is an old post but someone might still have this issue.

    What I realised was, on my Submit message / Go to page in my workflow, I was both setting a message on submit and a Go to page with the same page as the form. If you want the message to appear on the same page as the form, leave Go to page blank.

    It seemed to make sense to me at the time to specify that I wanted to redirect back to the homepage. Probably a bit of a brain fart on my behalf...

  • Chris Fitz-Avon 3 posts 95 karma points c-trib
    Jan 28, 2019 @ 16:38
    Chris Fitz-Avon
    1

    We had the same problem, but the workflow was configured correctly - the problem was with the dependency injection we were using (Autofac).

    We managed to resolve it by removing the .AsImplementedInterfaces() extension method when registering assemblies.

    Broken

            foreach (var assembly in umbracoFormsAssemblies)
            {
                builder.RegisterControllers(assembly);
                builder.RegisterApiControllers(assembly);
                builder.RegisterAssemblyTypes(assembly).AsImplementedInterfaces();
            }
    

    Working

            foreach (var assembly in umbracoFormsAssemblies)
            {
                builder.RegisterControllers(assembly);
                builder.RegisterApiControllers(assembly);
                builder.RegisterAssemblyTypes(assembly);
            }
    
Please Sign in or register to post replies

Write your reply to:

Draft