Skip to content
Discussion options

You must be logged in to vote

If both your forms need to show the same div's contents, can get by with a single script for both.

First off - change the wrapper to have no ID specified at all

<div>
    {{ craft.freeform.form('myContactForm').render }}
</div>

Then modify the script to have this code:
Notice that I changed the document.on to document.addEventListener. The docs will be updated with this change very soon

<script type="text/javascript">
    document.addEventListener('freeform-render-success', function (event) {
        event.preventDefault();

        var form = event.form;

        $(form).parent().html($('#custom-content').html());
    });
</script>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kjmartens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants