title: jquery mask dependent on drop down value
body: <p>I'm using the jquery mask from Digital Bush: <a href="http://digitalbush.com/projects/masked-input-plugin/" rel="nofollow">http://digitalbush.com/projects/masked-input-plugin/</a></p>
  
  <p>I have a customer signup form which references a mask, however since my customer base is both in the U.S. and Canada I need the mask for postal/zip code to change:</p>
  
  <p>Current mask rules:</p>
  
  <pre><code>    $(function($){
  jQuery(function($){
     $("#postal_code").mask("a9a-9a9");
  }); 
  })(jQuery);
  </code></pre>
  
  <p>The form is pretty standard and follows the following format:</p>
  
  <pre><code>&lt;select id="country" name="country"&gt;
  &lt;option selected="selected" value="0"&gt;&lt;/option&gt;
  &lt;option value="CA"&gt;Canada&lt;/option&gt;
  &lt;option value="US"&gt;United States&lt;/option&gt;
  &lt;/select&gt;
  
  &lt;input type="text" id="postal_code" name="postal_code" /&gt;
  </code></pre>
  
  <p>I was hoping someone could explain to me how I could change the $("postal_code").mask("a9a-9a9"); to $("postal_code").mask("99999");
  when United States is selected from the drop down list.</p>
  
  <p>Thanks in advance</p>