title: Validate Plugin - using the submitHandler
body: <p>My apologies if you have already seen this or replied to it but I can't seem to find the question I originally submitted and i'm desperate for a solution. </p>
  
  <p>I need to display a promotional message when the user clicks submit if 
  they meet certain criteria about their postcode. I have heard that you 
  should use the submitHandler but being completely new to JavaScript 
  and even newer to JQuery I am a little stuck on how I should write 
  this. I thought it would be something like this but it obviously 
  doesn't work. </p>
  
  <pre><code>submitHandler: function(form) { 
                      var special = /^[T]{1}[A]{1}([1-13|17|25]){2}/.test(value); 
                      if (special); 
                      alert('You have been entered into a competition to win a special    prize'); 
                      form.submit(); 
              }, // end of submitHandler 
  </code></pre>
  
  <p>I basically need this message to display when they click submit and 
  then they confirm and the form goes to the server. </p>
  
  <p>This is the code I have so far for the validation: </p>
  
  <pre><code> $(document).ready(function(){ 
   $("#orderForm").validate({ 
              onfocusout: function(element) { 
                      this.element(element); 
              }, 
              rules: { 
                      firstName: { 
                              required: true, 
                      }, 
                      surname: { 
                              required: true, 
                      }, 
                      phoneNumber: { 
                              required: true, 
                      }, 
                      streetName: { 
                              required: true, 
                      }, 
                      city: { 
                              required: true, 
                      }, 
                      postalCode: { 
                              required: true, 
                              shipPostalCode: true, 
                      }, 
                      billEmailAddress: { 
                              required: true, 
                      }, 
                      billPhoneNumber: { 
                              required: true, 
                      }, 
                      promoCardNumber: { 
                              required: true, 
                              fidelityCardNumber: true, 
                      }, 
                      billCardNumber: { 
                              required: true, 
                      }, 
                      billCardType: { 
                              required: true, 
                      }, 
              }, //end of rules 
      }); // end of validate 
      }); // end of function 
  
  
  $.validator.addMethod('postalCode', function (value) { 
              return /^[A-Z]{2}\d{1,2}\s\d{1}[A-Z]{2}$/.test(value); 
              }, 'Please enter a valid postcode'); 
  $.validator.addMethod('promoCardNumber', function (value) { 
              return /^[A-Z]{1}([A-Z]|\d){4}\s?([A-Z]|\d){5}\s?([A-Z]|\d){3}\d{1}$/.test  (value); 
              }, 'Please enter a valid card number'); 
  </code></pre>
  
  <p>This is my html code: </p>
  
  <pre><code>   &lt;form id="orderForm" method="post" action="x"&gt; 
    &lt;table id="formTable" cellpadding="5"&gt; 
      &lt;tr&gt; 
        &lt;td&gt; 
          &lt;h3&gt;Shipping and Billing Information&lt;/h3&gt; 
        &lt;/td&gt; 
        &lt;td&gt;&amp;nbsp;&lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td&gt;&lt;label for="firstname"&gt;First Name&lt;/label&gt;&lt;/td&gt; 
        &lt;td&gt;&lt;input id="firstName" type="text" name="firstName" maxlength="30" /&gt;&lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td&gt;&lt;label for="surname"&gt;Surname&lt;/label&gt;&lt;/td&gt; 
        &lt;td&gt;&lt;input id="surname" type="text" name="surname" maxlength="30" /&gt;&lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td&gt;&lt;label for="phoneNumber"&gt;Contact Telephone Number&lt;/label&gt;&lt;/td&gt; 
        &lt;td&gt;&lt;input id="phoneNumber" type="text" name="phoneNumber" maxlength="30" /&gt;&lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td&gt;&lt;label for="streetName"&gt;Street Name&lt;/label&gt;&lt;/td&gt; 
        &lt;td&gt;&lt;input id="streetName" type="text" name="streetName" maxlength="30" /&gt;&lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td&gt;&lt;label for="city"&gt;City&lt;/label&gt;&lt;/td&gt; 
        &lt;td&gt;&lt;input id="city" type="text" name="city" maxlength="30" /&gt;&lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td&gt;&lt;label for="postalCode"&gt;Post Code&lt;/label&gt;&lt;/td&gt; 
        &lt;td&gt;&lt;input id="postalCode" type="text" name="postalCode" maxlength="30" /&gt;&lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td&gt;&lt;label for="billEmailAddress"&gt;Email address&lt;/label&gt;&lt;/td&gt; 
        &lt;td&gt;&lt;input id="billEmailAddress" type="text" name="billEmailAddress" maxlength="30" /&gt;&lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td&gt;&lt;label for="billPhoneNumber"&gt;Contact Telephone Number&lt;/label&gt;&lt;/td&gt; 
        &lt;td&gt;&lt;input id="billPhoneNumber" type="text" name="billPhoneNumber" maxlength="30" /&gt;&lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td&gt;&lt;label for="promoCardNumber"&gt;Promotional Card&lt;/label&gt;&lt;/td&gt; 
        &lt;td&gt;&lt;input id="promoCardNumber" type="text" name="promoCardNumber" maxlength="30" /&gt;&lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td&gt;&lt;label for="billCardNumber"&gt;Credit Card Number&lt;/label&gt;&lt;/td&gt; 
        &lt;td&gt;&lt;input id="billCardNumber" type="text" name="billCardNumber" maxlength="30" /&gt;&lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td&gt;&lt;label for="billCardType"&gt;Credit Card Type&lt;/label&gt;&lt;/td&gt; 
        &lt;td&gt;&lt;select id="billCardType" name="billCardType"&gt; 
          &lt;option value="..."&gt; 
            Choose your card... 
          &lt;/option&gt; 
          &lt;option value="visa"&gt; 
            Visa 
          &lt;/option&gt; 
          &lt;option value="mastercard"&gt; 
            Mastercard 
          &lt;/option&gt; 
        &lt;/select&gt;&lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td&gt;&lt;label for="instructions"&gt;Instructions&lt;/label&gt;&lt;/td&gt; 
        &lt;td&gt; 
        &lt;textarea id="instructions" name="instructions" rows="8" cols="30"&gt; 
  Enter your requirements here or comments. &lt;/textarea&gt;&lt;/td&gt; 
      &lt;/tr&gt; 
      &lt;tr&gt; 
        &lt;td colspan="2"&gt;&lt;input id="submit" type="submit" name="Submit" value="Submit" /&gt; 
                &lt;/td&gt; 
      &lt;/tr&gt; 
    &lt;/table&gt; 
  &lt;/form&gt; 
  </code></pre>