A user fills out a webform that I created and it gets emailed me. Sometimes I get duplicate emails when they fill it out. I'm thinking that this is because they are hitting the submit button multiple times.

Is there a way to avoid these duplicate emails from happening? I use the smtp authentication support module and gmail to send the request out. Perhaps it's taking too long connect with gmail and the user is getting impatient, thus feeling the need to press the button continuously.


Your can deactive the submit button after it was clicked with custom javascript.

I write a sample below:

Drupal.behaviors.FormSubmitDisable = function (context) {
  $('YOUR BUTTON ID').click(function () {
    $(this).attr("disabled", "true");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.