title: Buttons must be pressed in a specific order to send the form - jquery
body: <p>I am trying to make a puzzle game in which the user must press the button in a specific order in which they fill a textbox (will be hidden) with a password ( 3-digits) if the user pressed the buttons for example ( 3,2,1 ) the form will be submitted automatically and redirecting to another page..</p>
  
  <p>I tried, but I couldn't do it </p>
  
  <p>here are my codes :</p>
  
  <pre><code>&lt;form  method="POST"&gt;
  &lt;input type="text"  value="" id="text1" name="text1" style="width: 150px;" /&gt;
  &lt;br /&gt;
  &lt;input type="button" value="Click Me" id="1" /&gt;
  &lt;input type="button" value="Click Me" id="2" /&gt;
  &lt;input type="button" value="Click Me" id="3" /&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>jquery</p>
  
  <pre><code>$(function () {
      $('#1').click(function(e) {
          var text = $('#text1');
          text.val(text.val() + '1');  
          $('#1').attr("disabled", true);     
  
      });
          $('#2').click(function(e) {
          var text = $('#text1');
          text.val(text.val() + '2');    
          $('#2').attr("disabled", true);     
      });
              $('#3').click(function(e) {
          var text = $('#text1');
          text.val(text.val() + '3');    
          $('#3').attr("disabled", true);     
      });
  
  });
  $('#text1').trigger('change') {
       alert('Changed');
  });
  </code></pre>