title: onsubmit not calling js function in chrome but submitting form directly
body: <p>My form is working fine in Firefox and IE. On calling onsubmit it calls js function and validates the code, and if validation is good, then it submits the form.</p>
  
  <p>However, in chrome it is not doing validation, but simply submitting the form directly.</p>
  
  <p>I am not sure why it is so, Did lot of search but in vain.</p>
  
  <p>Any help will be great towards solving this issue.</p>
  
  <p>Form Code:</p>
  
  <pre><code>&lt;form name="myform" action="queryfeedback.php" method="post" onSubmit="return validateForm(myform);"&gt;
  &lt;label for="labelField_Name" id="idLabel_Name"&gt;&lt;/label&gt;
  &lt;input type="text" name="nameField_Name" id="idField_Name" placeholder="Enter your name here"/&gt;
  &lt;br /&gt;
  &lt;label for="labelField_EMail" id="idLabel_EMail"&gt;&lt;/label&gt;
  &lt;input name="nameField_EMail" type="text" id="idField_EMail" placeholder="Enter your E-Mail address here" /&gt;
  &lt;br /&gt;
  &lt;label for="labelField_Message" id="idLabel_Message"&gt;&lt;/label&gt;
  &lt;textarea name="nameField_Message" id="idField_Message" placeholder="Enter your message for us here"&gt;&lt;/textarea&gt;
  &lt;br /&gt;
  &lt;input type="Submit" name="nameSubmit" id="idButton_Submit" value="Submit"  alt="Submit Button"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Validation Code:</p>
  
  <pre><code>    function validateForm(form)
  { 
  alert(form.nameField_Name.value);
  //alert(formValueEMail.value);
  //alert(formValueMessage.value);
  if(form.nameField_Name.value=='')
  {
      alert("Name field is required. Please fill it in.");
      form.nameField_Name.focus();
      form.nameField_Name.select();
      return false;
  }
  if(form.nameField_Name.value=='Enter your name here')
  {
      alert("Name field is required. Please fill it in.");
      form.nameField_Name.focus();
      form.nameField_Name.select();
      return false;
  }
  if(form.nameField_EMail.value=='')
  {
      alert("E-Mail Address field is required. Please fill it in.");
      form.nameField_EMail.focus();
      form.nameField_EMail.select();
      return false;
  }
  if(form.nameField_EMail.value=='Enter your E-Mail address here')
  {
      alert("E-Mail Address field is required. Please fill it in.");
      form.nameField_EMail.focus();
      form.nameField_EMail.select();
      return false;
  }
  //Checking for correct format of EMail address.
  var x=document.forms["myform"]["nameField_EMail"].value;
  var atpos=x.indexOf("@");
  var dotpos=x.lastIndexOf(".");
  if (atpos&lt;1 || dotpos&lt;atpos+2 || dotpos+2&gt;=x.length)
  {
      alert("Not a valid e-mail address");
      return false;
  }
  if(form.nameField_Message.value=='')
  {
      alert("Message field is required. Please fill it in.");
      form.nameField_Message.focus();
      form.nameField_Message.select();
      return false;
  }
  if(form.nameField_Message.value=='Enter your message for us here')
  {
      alert("Message field is required. Please fill it in.");
      form.nameField_Message.focus();
      form.nameField_Message.select();
      return false;
  }
  return true;
  </code></pre>