• Resolved dzamanakos

    (@dzamanakos)


    Hi, today i found out that some forms have a problem.
    I’m using
    jQuery(‘.wpcf7-form button’).click(function() to hide the submit button after user clicks on it and
    document.addEventListener( ‘wpcf7submit’, function( event ) to show it again.
    Some forms have this problem :
    when some empty required fields exist and user submits, the button is hidden, the error “you must fill all required fields” is displayed and then the button is shown again.
    At that case the functions are working and i can “catch” the wpcf7submit event.
    When the user submits the same form with all data required, the button is hidden, but the js cant “catch” the wpcf7submit event and the button is not shown again. Also, the “the form submitted successfully” message is not shown, but the system sends the email and the submission of the form is recorded to flamingo plugin.

    What should i check?

    best regards,

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Where can we see the website in question?

    Thread Starter dzamanakos

    (@dzamanakos)

    Hi, thank you for your fast reply.
    One of the forms is on : https://www.eyath.gr/registration-of-metering-readings/?lang=en
    The javascript i’m using, for the form events, is in one of the site’s js:

    if (jQuery(“.wpcf7”).length > 0) {
    jQuery(‘.wpcf7-form button’).click(function() {
    jQuery(‘.loading’).show();
    jQuery(‘.wpcf7-form button’).hide();
    console.log(‘hide’);
    })

    document.addEventListener( ‘wpcf7submit’, function( event ) {
    console.log(‘show’);
    jQuery(‘.loading’).hide();
    jQuery(‘.wpcf7-form button’).show();
    console.log(‘found2’);
    }, false );

    }

    best regards,

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    What other plugins and theme do you use on the site?

    Thread Starter dzamanakos

    (@dzamanakos)

    Hi, i’m using various plugins and a theme from themeforest, but there are other forms in the website where the wpcf7submit is working. I have 15 forms, some are working, some not, with the same plugins running in each form (by not working i mean that i cant catch the wpcf7submit event, the emails are sent from all forms).
    You think it’s a plugin conflict?
    Are you suggesting to start disabling the plugins?
    I would do that if all the forms were not working, but i can make a test site and start disabling.

    best regards,

    Thread Starter dzamanakos

    (@dzamanakos)

    Hi, a follow up. The problem was solved.
    The problem was not caused by the js code but from a code running with the add_action( ‘wpcf7_mail_sent’, ‘handle_form_submission’ ); hook.

    In my function i’m posting every from with php curl to another host.
    That post caused the “success message” not showing, even though the curl was running under 1 sec.
    I changed the curl with a async library in order to stop the form to wait for the response and all worked.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘problem with submits’ is closed to new replies.