• Jg

    (@adesignday)


    Using the New DOM not outputting data on the redirect page, just empty.

    Old code:

    on_sent_ok: “location.replace(‘/equity-release-calculations/?cli-nam=’+document.getElementById(“firstname”).value+’&age=’+document.getElementById(“age”).value+’&prop-val=’+document.getElementById(“propertyvalue”).value);”

    DOM created in Functions.php:

    * DOM event method for passing demo CF7 data */

    add_action( ‘wp_footer’, ‘mycustom_wp_footer’ );

    function mycustom_wp_footer() {
    ?>
    <script type=”text/javascript”>
    document.addEventListener( ‘wpcf7mailsent’, function( event ) {
    location.replace(‘/equity-release-calculations/?cli-nam=’+document.getElementById(“firstname”).value+’&age=’+document.getElementById(“age”).value+’&prop-val=’+document.getElementById(“propertyvalue”).value);
    }, false );
    </script>
    <?php
    }

    Help would be apprieciated
    Regards
    A

  • The topic ‘Using the New DOM not outputting data’ is closed to new replies.