title: jQuery .ajax submit not working in IE and Chrome
body: <p>On any of my pages such as <a href="http://www.ninjatrader.com/about.php" rel="nofollow">this one</a> when you click the "Have a Question" button left column a form comes up through jQuery Tools overlay. You fill out the form, it submits to a PHP script (a local one) and if it validates and submits you get either a thank you or error message depending on what the response is from the server. Works great in FF, safari and Opera, but not in IE or Chrome. IE and Chrome just go and print the return message the .ajax looks for on a blank page with the script URL. I must have something incorrect as even my cross domain cURL ajax scripting works but not this! Here is the code</p>
  
  <pre><code>$(document).click(function() {
          $.validator.methods.equal = function(value, element, param) {
          return value == param;
      };
      var validator = $("#request").bind("invalid-form.validate", function() {
              $("#summary").html("Your form contains " + validator.numberOfInvalids() + " error(s), please fix.");
          }).validate({
              //debug: true,
              errorElement: "em",
              errorContainer: $("#summary"),
              errorPlacement: function(error, element) {
                  error.appendTo( element.parent("li"));
              },
              success: function(label) {
                  label.text("ok!").addClass("success");
              },
              submitHandler: function(form) {
                  $("#processing").show();
              var dataString = $(form).serialize();
                  $.ajax({
                  type: $("#request").attr('method'),
                  url: form.action,
                  data: dataString,
                  clearForm: true,
                  success: function(data) {
                      if (data=="SuccessMail Sent") {
                          $("#formWrap, #supportHdln").hide();
                              $("#thankYou").html('&lt;h2&gt;&lt;span&gt;Thank You&lt;/span&gt; We have received your request.&lt;/h2&gt;&lt;p&gt;A Customer Service Representative from NinjaTrader will contact you shortly.&lt;/p&gt;').fadeIn("slow");
                          } else {
                              $("#formWrap, #supportHdln").hide();
                              $("#error").html('&lt;h2&gt;&lt;span&gt;Uh Oh&lt;/span&gt; We are unable to process your request.&lt;/h2&gt;&lt;p&gt;Please make sure all fields were filled out correctly. If you are still having trouble, please &lt;a href=\"mailto:support@ninjatrader.com?subject=Support Email\"&gt;email us&lt;/a&gt;&lt;/p&gt;').fadeIn("slow");
                      }
                      }
                  });
              return false;
  
             },
              rules: {
                      hs_customer_firstname: {
                      required: true,
                      minlength: 2
                  },
                      hs_customer_lastname: {
                      required: true,
                      minlength: 2
                  },
                      hs_customer_email: {
                      required: true,
                      email: true
                  },
                      confirmEmail: {
                      required: true,
                      email: true,
                      equalTo: "#hs_customer_email"
                  },
                      hs_customer_phone: {
                      required: false,
                      digits: true
                  },
                      hs_category: {
                      required: true      
                  },
                      hs_customLargeTextField: {
                      required: true,
                      minlength: 20
                  },
                      math: {
                      required: true,
                      equal: &lt;?php echo $randomNumTotal; ?&gt;   
                  }
              },
  
              messages: {
                  hs_customer_firstname: {
                      required: "Please Enter Your First Name",
                      minlength: "Your First Name Must be at Least 2 Characters"
                  },
                  hs_customer_lastname: {
                      required: "Please Enter Your Last Name",
                      minlength: "Your Last Name Must be at Leaset 2 Characters"
                  },
                  hs_customer_email: {
                      required: "Please enter your email address",
                      email: "Please enter a valid email address"
                  },
                  confirmEmail: {
                      required: "Please Confirm Your Email Address",
                      email: "Please Enter a Valid Email Address",
                      equalTo: "Please Enter the Same Email Address as Above"
                  },
                  hs_customer_phone: {
                      digits: "Numbers only"
                  },
  
                  hs_category:  {
                      required: "Please Select a Category"
                  },
                  hs_customLargeTextField: {
                      required: "Please Leave a Comment",
                      minlength: "Your comment must be at least 20 characters"
                  },
                  math: {
                      required: "Please Solve the Problem",
                      equal: "Please Solve the Problem Correctly"
                  }
              }
          });
      });
  </code></pre>
  
  <p>and here's the tiny PHP script that runs it</p>
  
  <pre><code>&lt;?php
  
  if(empty($_POST['hs_customer_firstname']) || empty($_POST['hs_customer_lastname']) ||
  empty($_POST['hs_customer_email']) || empty($_POST['hs_category']) ||
  empty($_POST['hs_customLargeTextField']) || empty($_POST['math'])) {
  echo ('Success');
  }
  
  $headers = 'From: webmaster@ninjatrader.com' . "\r\n" .
         'Reply-To: webmaster@ninjatrader.com' . "\r\n" .
  
  $firstname = $_POST['hs_customer_firstname'] ;
  //more like this
  
  mail( "email@domain.com", "Support Request",
  //$_POST fields 
  "From: $email");
  if(mail($firstname, $lastname, $email, $category, $inquiry)) {
  echo ('Mail Sent');
  } else {
  echo ('Error: Mail failed');
  }
  
  ?&gt;
  </code></pre>