title: jQuery submit() works (as expected) in FF/Chrome but not in IE/Opera, any ideas why?
body: <p>I am using some javascript to check a form field against an array of possible matches. Dependent on match user is them presented with a confirm window and dependent on result form is either submitted or user is returned to the page. This process works as expected in Firefox and Chrome but in IE and Opera an alternative submit is still being triggered. Can anyone suggest how I can fix this?</p>
  
  <p>Script is trimmed of most data for simplicity.</p>
  
  <pre><code>$(function(){
      var check = ["All", "array", "values"];
      $('#Next').click(function(){
          $(this).addClass('hit');
          $('#Cancel').attr('disabled', 'disabled');
      });
      $('#Form').bind('submit', function(){
          if($(this).find('.hit').attr('id')=='Next'){
              $('#Next').removeClass('hit');
              var match = $('input[name="WHAT"]', $('#idBothAddressesTable')).val().trim();
              if(match.length==0){
                  var postCode = $('input[name="WHAT2"]', $('#idBothAddressesTable')).val().trim();
              }
              var matched = $.inArray(match, check);
              if(matched != -1){
                  var ask = confirm("This is the case, proceed or cancel");
                  if(ask==true){
                          $.post('dowhat.php',{flag: 1}, function()){
                          $('#Form').unbind('submit').submit();
                      });
                  }
                  else{
                      ('#Cancel').removeAttr('disabled');
                      return false;
                  }
              }
          }
      });
  });
  </code></pre>
  
  <p>Form actually has two submit values. Other than that is pretty basic, have trimmed away the bulk for simplicity again.</p>
  
  <pre><code>&lt;form action="nextpage.php" method="post" id="Form"&gt;
      &lt;input type="text" name="WHAT" /&gt;
      &lt;input type="text" name="WHAT2" /&gt;
      &lt;input type="submit" name="CANCEL" value="Cancel" id="Cancel" /&gt;
      &lt;input type="submit" name="NEXT" value="Next" id="Next" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>In firefox and chrome this appears to work when someone meets meets the ask==true critera. The $.post goes ahead and the form is submitted as if the "NEXT" submit were clicked.</p>
  
  <p>However in IE and Opera the $.post occurs but the form is submitted as if the the "CANCEL" were clicked.</p>
  
  <p>Can anyone explain this to me, I can't seem to find a solution?</p>