• Resolved darren823

    (@darren823)


    I have contact form 7 page and popup anything. I can’t get the email popup enquiry form to close after client hits submit?
    Have tried adding to php.functions:
    add_action( ‘wpcf7_mail_sent’, ‘after_send_mail_from_contact_form’ );
    function after_send_mail_from_contact_form($contact_form){
    // “<script> //Custombox.modal.close(); </script>”;
    }

    Would really appreciate assistance
    Darren

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Rafik

    (@rafikwp)

    Hello,

    Please add below code in your theme function.php

    add_action( 'wp_footer', 'my_footer_scripts' );
    function my_footer_scripts(){
      ?>
     <script>
    document.addEventListener( 'wpcf7mailsent', function( event ) {
      Custombox.modal.close(); 
    }, false );
    </script>
      <?php
    }
    Plugin Author Anoop Ranawat

    (@anoopranawat)

    Hello @darren823

    Is there any update?

    Thread Starter darren823

    (@darren823)

    Hi Anoop
    Thank you very much for the code.
    Works great, only question I have is….. the form closes as I asked when hit submit button, but there is no sent confirmation. Some people might wonder if the email was actually sent?
    If it’s not possible its okay, I’ll try and set up an autoreply, but can there be a message saying your message was sent successfully. As I said, if it’s too hard or not possible its okay.
    I really appreciate your help ??

    Darren

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Close on Submit’ is closed to new replies.