title: Send a button value with jQuery Ajax
body: <p>I have a litle problem with the following code:</p>
  <pre><code>&lt;script type = &quot;text/javascript&quot; &gt;
  $(document).ready(function() {
      $(&quot;#click&quot;).click(function() {
          var jegy = $(this).attr('value');
          var dataString = $(&quot;#jegyform&quot;).serialize();
  
          $.ajax({
              type: &quot;POST&quot;,
              url: &quot;jegybeiras.php&quot;,
              data: dataString + '&amp;jegy=' + jegy,
              cache: false,
              success: function(html) {
                  $(&quot;#jegyek&quot;).html(html);
              }
          });
  
      });
  }); 
  &lt;/script&gt;
  </code></pre>
  <p>And a form where is the following buttons (and other inputs)</p>
  <pre><code>&lt;button id=&quot;click&quot; name=&quot;jegy&quot; type=&quot;submit&quot; value=&quot;p5&quot;&gt;5&lt;/button&gt;
  &lt;button id=&quot;click&quot; name=&quot;jegy&quot; type=&quot;submit&quot; value=&quot;p4&quot;&gt;4&lt;/button&gt;
  &lt;button id=&quot;click&quot; name=&quot;jegy&quot; type=&quot;submit&quot; value=&quot;p3&quot;&gt;3&lt;/button&gt;
  &lt;button id=&quot;click&quot; name=&quot;jegy&quot; type=&quot;submit&quot; value=&quot;p2&quot;&gt;2&lt;/button&gt;
  &lt;button id=&quot;click&quot; name=&quot;jegy&quot; type=&quot;submit&quot; value=&quot;p1&quot;&gt;1&lt;/button&gt;
  </code></pre>
  <p>My question is that, how can I post the clicked button value, it is working now but randomly for 4th-5th clicking on the actual button.</p>