title: PHP not working with a submit button in a form with Jquery
body: <p>I've set up a form with submit buttons to do a vote. The data will be stored in the database with php. To prevent spamming I searched for a jquery option to disable the buttons for a certain time. Unfortunately it is not working in a form. For exmaple, if I remove the form around the buttons it works fine but because I have to store the value's of the buttons I need to have the form attribute. What happens now is that AND my form is not handling the php code above (I did not put in the code for that) and the disable button function is not working (the button is disabled for like 1sec instead of what it suppose to be).</p>
  
  <pre><code>    &lt;div class="row"&gt;
          &lt;form name="stemmen" id="formstemmen" action="stemmensofeed.php" method="post"&gt;
  
          &lt;div class="col-xs-12 col-sm-3 col-md-2 col-lg-1" style="margin-bottom: 10px;"&gt;
  
              &lt;?php if (!empty($answer1)) { echo '&lt;input type="submit" id="wordpress" class="btn btn-primary" name="wordpress" value='.$answer1.'&gt;'; } ?&gt;
  
          &lt;/div&gt;
          &lt;div class="col-xs-12 col-sm-3 col-md-2 col-lg-1" style="margin-bottom: 10px;"&gt;
  
              &lt;?php if (!empty($answer2)) { echo '&lt;input type="submit" class="btn btn-primary" name="laravel" value='.$answer2.'&gt;'; } ?&gt;
  
          &lt;/div&gt;
          &lt;div class="col-xs-12 col-sm-3 col-md-2 col-lg-1" style="margin-bottom: 10px;"&gt;
  
              &lt;?php if (!empty($answer3)) { echo '&lt;input type="submit" class="btn btn-primary" name="html" value='.$answer3.'&gt;'; } ?&gt;
  
          &lt;/div&gt;
  
          &lt;div class="col-xs-12 col-sm-3 col-md-2 col-lg-1" style="margin-bottom: 10px;"&gt;
  
              &lt;?php if (!empty($answer4)) { echo '&lt;input type="submit" class="btn btn-primary" name="css" value='.$answer4.'&gt;'; } ?&gt;
  
           &lt;/div&gt;
  
          &lt;div class="col-xs-12 col-sm-3 col-md-2 col-lg-1" style="margin-bottom: 10px;"&gt;
  
              &lt;?php if (!empty($answer5)) { echo '&lt;input type="submit" class="btn btn-primary" name="bootstrap" value='.$answer5.'&gt;'; } ?&gt;
  
          &lt;/div&gt;
  
          &lt;/form&gt;
  
  
  
      &lt;/div&gt;
  
  
      &lt;!-- jQuery 2.2.0 --&gt;
      &lt;script src="admin/plugins/jQuery/jQuery-2.2.0.min.js"&gt;&lt;/script&gt;
      &lt;!-- Include all compiled plugins (below), or include individual files as needed --&gt;
      &lt;script src="bootstrap-sass/assets/javascripts/bootstrap.js"&gt;&lt;/script&gt;
  &lt;script&gt;
      $('input#wordpress').click(function() {
      var aaa =  $(this);
      aaa.prop('disabled', true);
      setTimeout(function() {
      aaa.prop('disabled', false);
      }, 3000);
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>I am not a expert at javascript and jquery, so is there someone who can help me out with this?</p>
  
  <p>A fiddle from the orginal code <a href="http://jsfiddle.net/jhNcM/" rel="nofollow">http://jsfiddle.net/jhNcM/</a> = the expected result (+ handle php code from form).</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I've managed to get the disable button working, Thanks to @Koustav Ray, by this code</p>
  
  <pre><code>$('input#wordpress').click(function(e) { //added e
      e.preventDefault(); //added this
      var aaa =  $(this);
      aaa.prop('disabled', true);
      setTimeout(function() {
      aaa.prop('disabled', false);
      }, 3000);
      });
  </code></pre>
  
  <p>Unfortunately the form will now not handle the php code.. Please help with this matter!</p>