title: form validation not working, for gettting submitted without being validated
body: <p>i dont understand what am i doing wrong here.... tried almost everything still the form is being submitted without validation. i dont know what's causing the problem here been working on this for past 4 hours, everytime i click on the submit button it goes straight to the submission successful page... can anyone help me with this?</p>
  
  <pre><code>&lt;script type ="text/javascript"&gt;
  function validate(){
  if(document.orderForm.firstName.value=="" ){
  document.getElementById('errors').innerHTML = "Please Enter a First Name";
  document.orderForm.fistName.focus();
  return (false);
  }
  if(document.orderForm.lastName.value == "" ){
  document.getElementById('errors').innerHTML = "Please Enter a Last Name";
  document.orderForm.lastName.focus();
  return (false);
  }
  if(document.orderForm.address.value == "" ){
  document.getElementById('errors').innerHTML = "Please Enter a address");
  document.orderForm.address.focus();
  return (false);
  }
  if(document.orderForm.city.value == "" ){
  document.getElementById('errors').innerHTML = "Please Enter a City");
  document.orderForm.city.focus();
  return (false);
  }
  if(document.orderForm.postalCode.value == "" ||
  document.orderForm.postalCode.value.length != 6 ){
  document.getElementById('errors').innerHTML = "Please Enter a correct PostalCode");
  document.orderForm.postalCode.focus(); 
  return (false);
  }
  if(document.orderForm.province.value == "Select" ){
  document.getElementById('errors').innerHTML = "Please Select your province")
  return (false);
  }
  if(document.orderForm.widget1qty.value == "0" || document.orderForm.widget1qty.value == "" &amp;&amp;
  document.orderForm.widget2qty.value == "0" || document.orderForm.widget2qty.value == "" &amp;&amp;
  document.orderForm.widget2qty.value == "0" || document.orderForm.widget2qty.value == "" ){
  document.getElementById('errors').innerHTML = "Please Select at least one item")
  return (false);
  }
  else
  {
  return(true);
  }
  }
  &lt;/script&gt;
  
  
  
      &lt;form name="orderForm" method="POST" action="processForm.html" onSubmit="return validate();"&gt;
  </code></pre>