WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
Disabling submit button while waiting for server response (2 posts)

  1. gauwon
    Member
    Posted 3 years ago #

    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!

  2. yamatzaki
    Member
    Posted 3 years ago #

    Hello,
    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">
    <tr>
    <td>[text* Nombre class:textfield-secu "Nombre completo"]</td>
    </tr>
    <tr>
    <td>[email* Email class:textfield-secu "Email"]</td>
    </tr>
    <tr>
    <td>[text Telefono class:textfield-secu "Teléfono"]</td>
    </tr>
    <tr>
    <td>
    [select Interes id:Interes class:secu-drop "Nivel Académico de interés" "Guardería" "Maternal" "Preescolar" "Pre-First" "Primaria" "Secundaria" "Preparatoria"]
    </td>
    </tr>
    <tr>
    <td style="text-align:center;">[submit id:send-secu class:send-secu]</td>
    </tr>
    </table>

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic