Support » Plugin: Usernoise modal feedback / contact form » Run JavaScript On Submission?

Viewing 1 replies (of 1 total)
  • I tried this:

    jQuery(document).on('click','#un-feedback-submit',function() {
    	console.log('Ow!');
    });

    Then I realized the form is in an iframe, so that doesn’t work.

    I tried this in my theme’s functions:

    function trackFeedbackSubmission() {
    	echo '<script type="text/javascript">
    		ga("send","event","form","contact");
    		console.log("Submission tracking attempted");
    	</script>';
    }
    add_action('un_feedback_created','trackFeedbackSubmission');

    Which results in this error in the JavaScript console on form submission:

    SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

Viewing 1 replies (of 1 total)
  • The topic ‘Run JavaScript On Submission?’ is closed to new replies.