Copied to clipboard

Flag this post as spam?

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


  • Ben Palmer 180 posts 866 karma points c-trib
    Jan 15, 2020 @ 16:17
    Ben Palmer
    0

    Hijacking Form Submit

    Hi,

    I'm attempting to setup a site using Umbraco Forms and am in need of posting off the data to a CRM. Usually, I would achieve this using "Post to URL" workflow but in this project, we need to know whether the record has been successfully submitted or not. If the submission fails, we redirect to an error page, otherwise, if it's successful, we redirect to a thank you page.

    As far as I know, this can't be achieved with Workflows because they're executed separately.

    The only solution I have right now is to hijack with JavaScript or a custom controller but neither feels like the right solution.

    Is there anyway to subscribe to Umbraco Form events or otherwise perform an action on submission, and make actions based on it?

    Thanks,

    Ben

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Jan 15, 2020 @ 16:32
    Alex Skrypnyk
    0

    Hi Ben

    What do you mean by successfully submitted? Do you need to do some validation? I believe that validation can be done before workflows.

    Thanks,

    Alex

  • Ben Palmer 180 posts 866 karma points c-trib
    Jan 16, 2020 @ 11:37
    Ben Palmer
    0

    Thanks Alex,

    When I say successfully submitted I mean that the form data reaches the CRM, so not validation.

    The process would be the user submits the form, the data is sent to the CRM and if the CRM returns a success, we redirect to a thank you page. Else, redirect to an error page.

    Thanks,

    Ben

  • Graham Davis 110 posts 376 karma points
    Jan 17, 2020 @ 01:37
    Graham Davis
    0

    Your first instinct was correct. Custom coding this in JavaScript would be the proper way to handle it.

  • Fernando 13 posts 82 karma points
    Jun 14, 2022 @ 15:16
    Fernando
    0

    Hi, I want to validate form data using javascript before the workflow is executed. Where should I add the js script? I donĀ“t know how to run any js script before the workflow is executed. Thanks.

Please Sign in or register to post replies

Write your reply to:

Draft