• Hi,

    I need to fire an onClick function when the form is submitted successfully.
    <input type=”submit” name=”Submit” value=”Submit” onClick=”confirmOptIn();”>

    So far I’ve done the following:

    1. Added the following in theme’s functions.php

    function conversityCheckbox1( $contact_form )
    {
        $wpcf7 = WPCF7_ContactForm::get_current();
        $submission = WPCF7_Submission::get_instance();
    
        if ( $submission )
    	{
    		// CUSTOM  CODE HERE TO FIRE CURL LINK
        }
    }
    add_action( 'wpcf7_mail_sent', 'conversityCheckbox1' );

    `

    2. Added the following line to wp-content/plugins/contact-from-7/includes/submission.php (at the end)

    do_action( 'wpcf7_mail_sent', $contact_form );

    But when I check the access logs at the CURL LINK, there is nothing which means, the above code did not execute and the CURL code did not execute.

    I’m at loss of options here.

    Pls suggest what I may have missed or what I’m doing wrong.

    Thanks

  • The topic ‘Cannot get onClick to work’ is closed to new replies.