• Hello,

    We use the plugin and we want to make a log with the contents of the emails sent.

    We use Code Snippets plugin to insert PHP code blocks in our WordPress theme but when we try to write

    document.addEventListener( 'wpcf7submit', function( event ) {
      var inputs = event.detail.inputs;
     
      for ( var i = 0; i < inputs.length; i++ ) {
        if ( 'your-name' == inputs[i].name ) {
          alert( inputs[i].value );
          break;
        }
      }
    }, false );

    The code doesn’t work. The error is:

    Don’t Panic
    The code snippet you are trying to save produced a fatal error on line 1:

    syntax error, unexpected ‘)’, expecting variable (T_VARIABLE)

    Any clue how to make it work?

Viewing 1 replies (of 1 total)
  • ciao @johnth,

    seems you miss to wrap the javascript code into:

    ?>
        <script type="text/javascript">
          ...your javascript code...
        </script>
    <?php

    maybe this is the reason?

Viewing 1 replies (of 1 total)
  • The topic ‘DOM events – Log file’ is closed to new replies.