Support » Plugin: Contact Form 7 » Disabling submit button while waiting for server response

  • gauwon


    First of all, I would like to say Thank you for creating great plugin!
    I used Contact form 7 with DB extension for a while and noticed that people press submit button multiple times while waiting for server response. (I noticed this behavior because I found so many double entry on my database)

    It is easily prevented by disabling submit button during ajax communication after people click submit button.
    I added two line codes in your scripts.js as following.

    after line11 (in beforeSubmit event):
    $(‘form.wpcf7-form input.wpcf7-submit’).attr(‘disabled’,’disabled’);

    after line25 (in success event):
    $(‘form.wpcf7-form input.wpcf7-submit’).attr(‘disabled’,”);

    Please give me your feedback. Thank you!

Viewing 1 replies (of 1 total)
  • yamatzaki


    I´m new using word press and I have a website that I didn´t design using contact 7 and it is like this:

    <table width=”100%” border=”0″ cellpadding=”0″ cellspacing=”0″>
    <td>[text* Nombre class:textfield-secu “Nombre completo”]</td>
    <td>[email* Email class:textfield-secu “Email”]</td>
    <td>[text Telefono class:textfield-secu “Teléfono”]</td>
    [select Interes id:Interes class:secu-drop “Nivel Académico de interés” “Guardería” “Maternal” “Preescolar” “Pre-First” “Primaria” “Secundaria” “Preparatoria”]
    <td style=”text-align:center;”>[submit id:send-secu class:send-secu]</td>

    but the problem is that I need to disable the submit button until I get the server response

    any ideas? because I don´t want to change the hall site

    Thank you

Viewing 1 replies (of 1 total)
  • The topic ‘Disabling submit button while waiting for server response’ is closed to new replies.