title: JavaScript Form Validation - specific field entry needed but in upper/lower case
body: <p>I have a simple form with a single field which essentially works like a password, only letting a user to the next page when they click submit, if the correct 'referral code' is entered in the field.</p>
  
  <p>I need the my JS validation code to allow the word 'garlic' be entered in upper or lower case or a mixture of both to pass the validation. Only 'garlic' can be used as  the referral word though. The below code is what I have currently but it only specifically validates 'garlic' in all lower-case. </p>
  
  <p>Any assistance in being able to validate one word in upper and lower-case and both together would be much appreciated. </p>
  
  <pre><code>function ValidateContactForm() {
      var codeentry = document.form1.code;
      if (codeentry.value == "") {
          window.alert("Our apologies, the code does not match our records; please call us");
          codeentry.focus();
          return false;
      } else if (codeentry.value !== "garlic") {
          alert("Our apologies, the code does not match our records; please call us.");
          codeentry.focus();
          return false;
      }
      return true;
  }
  </code></pre>