Advice and answers from the Jumplead Team

If you need to work with form data or control the redirect action you can do so with the data-callback property and a callback function.

Add the conversion form as normal, adding a data-callback parameter:

//Jumplead form code
<div class="jlcf" data-id="12345a123bbb123456789c" data-callback="myActions"></div>


Then at the bottom of your page include your function:

<script>
    //Callback function
    function myActions(formData, callback)
    {
        //You can access the data from the fields of the form in the formData variable
        console.log(formData);

        //You could call a 'Thank you' modal.
        showConfirmationModelBox();

        //Usually you would call the callback variable when you're done with your code to redirect, but you can omit this call below to prevent a redirect and stay on the same URL
        // callback();
    }
</script>


Here is an example to replace the form with some text:

<div class="jlcf" data-id="12345a123bbb123456789c" data-callback="replaceFormWithMessage"></div>
<script>
    // Callback
    function replaceFormWithMessage() {
        var element = document.getElementsByClassName("jlcf")[0];
        element.innerHTML = 'Thanks for completing this form!';
        return false;
    }
</script>



Did this answer your question?