title: Laravel & JQuery form button click animation happens only once when form invalid then valid
body: <p>I have a button on a send email form that I would like to animate as 'sending' until the post response returns a value. It works great unless the user doesn't meet the input validation (ex. no emails entered). An error message is displayed, and my code changes the button back to normal, which is good. The problem is that if they then change their input to be valid and click the send button again, the button does not change, but the post still happens. Only this time, the user does not know that it is currently sending because the button has not changed or been disabled. The overall goal is to stop multiple clicks on the send button while it is loading. </p>
  
  <p>HTML (using Laravel syntax in a .blade.php file):</p>
  
  <pre><code>{{ Form::button('SEND',array('class'=&gt;'btn-green medium pull-right','id'=&gt;'completeExportToMail')) }}
  </code></pre>
  
  <p>Jquery:</p>
  
  <pre><code>$("#completeExportToMail").click(function(){
      var formData = $("#mailExportForm").serialize();
      var modal = '#modalEmailSave';
      $("#addError").empty();
      $('#modalEmailSave .help-inline').remove();
      $('#modalEmailSave .control-group').removeClass('error');
      validateForm();
  
      if($("#mailExportForm").valid()){
          $("#completeExportToMail").html('Sending... &lt;img src="../../../assets/img/loading.gif" alt="." style="width:15px; height:15px; margin-top:-4px;"&gt;&lt;/img&gt;');
          $('#completeExportToMail').prop('disabled', true);
  
          $.post(site+'object/mail', formData, function(response){
              if(response.status){
                 $(modal).modal('hide');
                 $(modal).on('hidden', function () {
                    $(modal+' #email').val('');
                 });
              }
              else{
                  $("#mailError").text(response.errors);
              }
  
              //Button reset whether or not email actually sends
              $("#completeExportToMail").html('Send');
              $('#completeExportToMail').prop('disabled', false);
          },'json');
      }
  });
  </code></pre>
  
  <p>Thanks!</p>