Copied to clipboard

Flag this post as spam?

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


  • Daniel 2 posts 83 karma points
    Aug 19, 2019 @ 23:40
    Daniel
    0

    Form Rendering in 3+

    Hi,

    I've downloaded version 3.0.0 via nuget and I'm hoping to get some help rendering the form.

    The instructions from your site http://www.formulate.rocks/render-form no longer seem valid. Namely, 'Rendering' is no longer present in the 'formulate.api' namespace. However, I was able to output the form content to the page like so:

    @Html.Action("Render", "FormulateRendering", new { form = Model.Form })

    However, the form does not render, presumably, because of some missing javascript dependecies. Can you please let me know what scripts I need to refence in my view to render a form in this new version?

    n.b. I'm on Umbraco 8.1, .Net 4.7.2

    Thanks in advance

  • Nicholas Westby 2034 posts 7009 karma points c-trib
    Aug 20, 2019 @ 15:25
    Nicholas Westby
    100

    Hi Daniel,

    I'm glad you were able to figure the hard part out (i.e., how to render the actual form data). This offers some guidance on the rest (i.e., displaying the form on the frontend): http://www.formulate.rocks/plain-javascript/render-form

    This is the key bit:

    @* The JavaScript file for Formulate's plain JavaScript template. *@
    <script src="/App_Plugins/formulate/responsive.plain-javascript.min.js" async></script>
    
    @* This is your JavaScript that handles events dispatched by Formulate. *@
    <script src="/scripts/custom-formulate-script.js" async></script>
    

    And this wrapper bit is somewhat important too (necessary in order for the custom-formulate-script.js to work):

    @* Wrap the form with this element so the custom JavaScript can find it. *@
    <div class="formulate-wrapper">
    
        @* Render the form as you've already done. *@
    
    </div>
    

    But the main bit is the JavaScript.

    Disclaimer: A colleague of mine has been leading the effort to support Umbraco 8 with Formulate 3, so there might be some nuances I'm not aware of. Give it a shot and let me know how it goes.

  • Daniel 2 posts 83 karma points
    Aug 21, 2019 @ 10:25
    Daniel
    1

    Ah, perfect! Yes, the form is rendering now. Thanks very much Nicholas!

Please Sign in or register to post replies

Write your reply to:

Draft