title: Change submit button value
body: <p>It may take a long time to complete the call.php and get the return value, how can I change the submit button's value to "Processing … " while the call.php is being executed? </p>
  
  <p>Submit button with id "submit_btn", there is no change to the script </p>
  
  <p><code>$('#submit_btn').val('Processing …')</code></p>
  
  <p>AJAX code</p>
  
  <pre><code>$(document).ready(function(){
      $('#form1').submit(function(e) {
          e.preventDefault();
          $('#submit_btn').val('Processing ...');
        $.ajax({
          cache: false, 
          type: "POST", 
          dataType: "json",
              data: $('#form1').serialize(),
          url: $('#form1').attr('action'),
          complete: function (HttpRequest, textStatus) {
                  $('#submit_btn').val('Create');
        }});
        return false;
    });
  });
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;form action="call.php" method="POST" id="form1" name="form1"&gt;
          &lt;input type="text" name="campname" id="campname"&gt;
          &lt;textarea id="longdesc" name="longdesc"&gt;&lt;/textarea&gt;
          &lt;input type="text" name="vercode" id="vercode" /&gt;
          &lt;input type="submit" value="Create" id="submit_btn" /&gt;
  &lt;/form&gt;
  </code></pre>