title: jQuery Validate plugin does not work with rules('add') method
body: <p>I've a problem...
  I'm working on a joomla custom search module for sobipro, which can search in a specific category, but can't search in its sub-categories.
  For this reason i need to validate the form and set as "Required" the "sid_list1" select list class.
  I'm trying to use the JQuery Validate Plugin, but it doesen't work for me.
  This is how i set him, any idea? </p>
  
  <pre><code>&lt;script text= type='text/javascript'&gt; 
  $("#XTspSearchForm132").validate(
  {
      rules:
      {
          $('.sid_list1').each(function() {
      $(this).rules('add', {
          required: true,
          messages: {
              required:  "your custom message"
          }
      });
  });
  &lt;/script&gt;
  
  &lt;form action="/index.php" method="post"
        id="XTspSearchForm132" &gt;
      &lt;div class="XTsearchhome"&gt;
  
  
  
  &lt;div class="XTSPSearch"&gt;
    &lt;div&gt;&lt;/div&gt;
    &lt;div class="spspacer" style="clear:both;"&gt;&lt;/div&gt;
    &lt;div id="XTSPSearchForm"&gt;
      &lt;div class="XTSPSearchCell1"&gt;
        &lt;div class="XTSPSearchLabel"&gt;
          &lt;strong&gt;Search for: &lt;/strong&gt;
        &lt;/div&gt;
        &lt;div class="XTSPSearchField"&gt;&lt;input type="text" name="sp_search_for" size="20" value="visibile"  onblur="if (this.value=='') this.value='search...';" onfocus="if (this.value=='search...') this.value='';" class="XTSPSearchBox inputboxhome" id="XTSPSearchBox132" maxlength="20"/&gt; &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="XTSPSearchCell2"&gt;
        &lt;div class="XTSPSearchField"&gt;&lt;input type="submit" id="XTtop_button" name="search" value="Search" class="buttonhome" onclick="this.form.sp_search_for.focus();extSearchHelper132.extractFormValues();"/&gt; &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="XTSPSearchCell3"&gt;
        &lt;div class="XTSPSearchLabel"&gt;
          &lt;strong&gt;Find entries that have: &lt;/strong&gt;
        &lt;/div&gt;
        &lt;div class="XTSPSearchField"&gt;&lt;span&gt;
  &lt;!-- RadioButton 'spsearchphrase' Output --&gt;
  &lt;input type="radio" name="spsearchphrase" id="XTspsearchphrase_all" value="all" checked="checked" /&gt;
  &lt;label for="XTspsearchphrase_all"&gt;All words&lt;/label&gt;
  &lt;!-- RadioButton 'spsearchphrase' End --&gt;
  &lt;/span&gt;&lt;span&gt;
  &lt;!-- RadioButton 'spsearchphrase' Output --&gt;
  &lt;input type="radio" name="spsearchphrase" id="XTspsearchphrase_any" value="any" /&gt;
  &lt;label for="XTspsearchphrase_any"&gt;Any words&lt;/label&gt;
  &lt;!-- RadioButton 'spsearchphrase' End --&gt;
  &lt;/span&gt;&lt;span&gt;
  &lt;!-- RadioButton 'spsearchphrase' Output --&gt;
  &lt;input type="radio" name="spsearchphrase" id="XTspsearchphrase_exact" value="exact" /&gt;
  &lt;label for="XTspsearchphrase_exact"&gt;Exact Phrase&lt;/label&gt;
  &lt;!-- RadioButton 'spsearchphrase' End --&gt;
  &lt;/span&gt; &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="spspacer" style="clear:both; margin-bottom: 10px;"&gt;&lt;/div&gt;
      &lt;div class="spspacer" style="clear:both; min-height: 2px;"&gt;&lt;/div&gt;
      &lt;div id="XTSPExtSearch"&gt;&lt;div class="XTSPSearchCell4"&gt;&lt;div class="XTSPSearchLabel"&gt;&lt;strong&gt;Categories:&lt;/strong&gt;&lt;/div&gt;&lt;div class="XTSPSearchField"&gt;&lt;select class='sid_list1' name='to_sid_list_1321' id='extparent_1321' style='margin-top:4px;'&gt;&lt;option style="" value="" selected="selected"&gt;- Seleziona categoria -&lt;/option&gt;&lt;option style="" value="spc55" class="spc63" &gt;Africa del Sud&lt;/option&gt;&lt;option style="" value="spc56" class="spc63" &gt;Nord America e Caraibi&lt;/option&gt;&lt;option style="" value="spc57" class="spc63" &gt;America Centrale&lt;/option&gt;&lt;option style="" value="spc58" class="spc63" &gt;Sud America&lt;/option&gt;&lt;option style="" value="spc59" class="spc63" &gt;Isole del Pacifico&lt;/option&gt;&lt;option style="" value="spc60" class="spc63" &gt;Oceano Indiano&lt;/option&gt;&lt;option style="" value="spc61" class="spc63" &gt;Penisola Arabica&lt;/option&gt;&lt;/select&gt;&lt;select class='sid_list2' name='to_sid_list_1322' id='extparent_1322' style='margin-top:4px;'&gt;&lt;option style="" value="" selected="selected"&gt;- Seleziona categoria -&lt;/option&gt;&lt;option style="" value="spc62" class="spc55" &gt;Botswana&lt;/option&gt;&lt;option style="" value="spc64" class="spc55" &gt;Mauritius e Seychelles&lt;/option&gt;&lt;option style="" value="spc65" class="spc55" &gt;Mozambico&lt;/option&gt;&lt;option style="" value="spc66" class="spc55" &gt;Namibia&lt;/option&gt;&lt;option style="" value="spc67" class="spc55" &gt;Zimbabwe e Zambia&lt;/option&gt;&lt;option style="" value="spc68" class="spc55" &gt;Sudafrica&lt;/option&gt;&lt;option style="" value="spc69" class="spc56" &gt;Anguilla&lt;/option&gt;&lt;option style="" value="spc70" class="spc56" &gt;Antigua e Barbados&lt;/option&gt;&lt;option style="" value="spc71" class="spc56" &gt;Aruba&lt;/option&gt;&lt;option style="" value="spc72" class="spc56" &gt;Bahamas&lt;/option&gt;&lt;option style="" value="spc73" class="spc56" &gt;Bermuda&lt;/option&gt;&lt;option style="" value="spc74" class="spc56" &gt;Giamaica&lt;/option&gt;&lt;option style="" value="spc75" class="spc56" &gt;Rep Dominicana&lt;/option&gt;&lt;option style="" value="spc76" class="spc56" &gt;St Lucia&lt;/option&gt;&lt;option style="" value="spc77" class="spc56" &gt;St Martin&lt;/option&gt;&lt;option style="" value="spc78" class="spc56" &gt;Turks and Caicos&lt;/option&gt;&lt;option style="" value="spc79" class="spc56" &gt;US &amp;amp; British Virgin Islands&lt;/option&gt;&lt;option style="" value="spc80" class="spc56" &gt;Canada&lt;/option&gt;&lt;option style="" value="spc81" class="spc56" &gt;Canouan Island&lt;/option&gt;&lt;option style="" value="spc82" class="spc56" &gt;Stati Uniti&lt;/option&gt;&lt;option style="" value="spc83" class="spc57" &gt;Belize&lt;/option&gt;&lt;option style="" value="spc84" class="spc57" &gt;Costa Rica&lt;/option&gt;&lt;option style="" value="spc85" class="spc57" &gt;Guatemala&lt;/option&gt;&lt;option style="" value="spc86" class="spc57" &gt;Messico&lt;/option&gt;&lt;option style="" value="spc87" class="spc57" &gt;Panama&lt;/option&gt;&lt;option style="" value="spc88" class="spc58" &gt;Equador&lt;/option&gt;&lt;option style="" value="spc89" class="spc58" &gt;Perù&lt;/option&gt;&lt;option style="" value="spc90" class="spc59" &gt;Hawaii&lt;/option&gt;&lt;option style="" value="spc91" class="spc59" &gt;Polinesia Francese&lt;/option&gt;&lt;option style="" value="spc92" class="spc60" &gt;Seishelles&lt;/option&gt;&lt;option style="" value="spc93" class="spc60" &gt;Mauritius&lt;/option&gt;&lt;option style="" value="spc94" class="spc61" &gt;Dubai&lt;/option&gt;&lt;option style="" value="spc95" class="spc61" &gt;Oman&lt;/option&gt;&lt;/select&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="spspacer" style="clear:both; margin-bottom: 10px;"&gt;&lt;/div&gt;
        &lt;div class="XTSPSearchCell5"&gt;
          &lt;div class="XTSPSearchLabel"&gt;
            &lt;strong&gt;Prodotto: &lt;/strong&gt;
          &lt;/div&gt;
          &lt;div class="XTSPSearchField"&gt;&lt;select id="XTfield_prodotto" name="field_prodotto" id="XTfield_prodotto" class="XTSPSearchSelect" &gt;
      &lt;option value=""&gt; --- Select Prodotto  --- &lt;/option&gt;
      &lt;option value="prodotto_option_12"&gt;Noleggio auto&lt;/option&gt;
      &lt;option value="prodotto_option_11"&gt;Escursioni&lt;/option&gt;
      &lt;option value="prodotto_option_10"&gt;Soggiorni Mare&lt;/option&gt;
      &lt;option value="prodotto_option_9"&gt;Tour in Auto&lt;/option&gt;
      &lt;option value="prodotto_option_8"&gt;Tour di Gruppo&lt;/option&gt;
      &lt;option value="prodotto_option_7"&gt;Minitour&lt;/option&gt;
      &lt;option value="prodotto_option_6"&gt;Noleggio moto&lt;/option&gt;
      &lt;option value="prodotto_option_5"&gt;Noleggio camper&lt;/option&gt;
  &lt;/select&gt; &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="spspacer" style="clear:both; margin-bottom: 10px;"&gt;&lt;/div&gt;
        &lt;div class="XTSPSearchCell6"&gt;
          &lt;div class="XTSPSearchLabel"&gt;
            &lt;strong&gt;Paese: &lt;/strong&gt;
          &lt;/div&gt;
          &lt;div class="XTSPSearchField"&gt;&lt;select id="XTfield_paese" name="field_paese" id="XTfield_paese" class="XTSPSearchSelect" &gt;
      &lt;option value=""&gt; --- Select Paese  --- &lt;/option&gt;
      &lt;optgroup label="Africa del Sud"&gt;
          &lt;option value="paese_option_7"&gt;Botswana&lt;/option&gt;
          &lt;option value="paese_option_10"&gt;Mauritius e Seychelles&lt;/option&gt;
          &lt;option value="paese_option_9"&gt;Mozambico&lt;/option&gt;
          &lt;option value="paese_option_11"&gt;Nambia&lt;/option&gt;
          &lt;option value="paese_option_12"&gt;Sudafrica&lt;/option&gt;
          &lt;option value="paese_option_8"&gt;Zimbawe e Zambia&lt;/option&gt;
      &lt;/optgroup&gt;
      &lt;optgroup label="America Centrale"&gt;
          &lt;option value="paese_option_18"&gt;Belize&lt;/option&gt;
          &lt;option value="paese_option_17"&gt;Costarica&lt;/option&gt;
          &lt;option value="paese_option_16"&gt;Guatemala&lt;/option&gt;
          &lt;option value="paese_option_15"&gt;Messico&lt;/option&gt;
          &lt;option value="paese_option_14"&gt;Panama&lt;/option&gt;
      &lt;/optgroup&gt;
      &lt;optgroup label="Nord America e Caraibi"&gt;
          &lt;option value="paese_option_37"&gt;Anguilla&lt;/option&gt;
          &lt;option value="paese_option_36"&gt;Antigua e Barbados&lt;/option&gt;
          &lt;option value="paese_option_35"&gt;Aruba&lt;/option&gt;
          &lt;option value="paese_option_34"&gt;Bahamas&lt;/option&gt;
          &lt;option value="paese_option_33"&gt;Bermuda&lt;/option&gt;
          &lt;option value="paese_option_26"&gt;Canada&lt;/option&gt;
          &lt;option value="paese_option_25"&gt;Canouan Island&lt;/option&gt;
          &lt;option value="paese_option_32"&gt;Giamaica&lt;/option&gt;
          &lt;option value="paese_option_31"&gt;Rep Dominicana&lt;/option&gt;
          &lt;option value="paese_option_30"&gt;St Lucia&lt;/option&gt;
          &lt;option value="paese_option_29"&gt;St Martin&lt;/option&gt;
          &lt;option value="paese_option_24"&gt;Stati Uniti&lt;/option&gt;
          &lt;option value="paese_option_28"&gt;Turks and Caicos&lt;/option&gt;
          &lt;option value="paese_option_27"&gt;US &amp;amp; British Virgin Islands&lt;/option&gt;
      &lt;/optgroup&gt;
      &lt;optgroup label="Oceano Indiano"&gt;
          &lt;option value="paese_option_178"&gt;Seishelles&lt;/option&gt;
          &lt;option value="paese_option_177"&gt;Mauritius&lt;/option&gt;
      &lt;/optgroup&gt;
      &lt;optgroup label="Pacific Islands"&gt;
          &lt;option value="paese_option_149"&gt;Hawaii&lt;/option&gt;
          &lt;option value="paese_option_148"&gt;Polinesia Francese&lt;/option&gt;
      &lt;/optgroup&gt;
      &lt;optgroup label="Penisola Arabica"&gt;
          &lt;option value="paese_option_182"&gt;Dubai&lt;/option&gt;
          &lt;option value="paese_option_181"&gt;Oman&lt;/option&gt;
      &lt;/optgroup&gt;
      &lt;optgroup label="Sud America"&gt;
          &lt;option value="paese_option_146"&gt;Equador&lt;/option&gt;
          &lt;option value="paese_option_145"&gt;Perù&lt;/option&gt;
      &lt;/optgroup&gt;
  &lt;/select&gt; &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="spspacer" style="clear:both; margin-bottom: 10px;"&gt;&lt;/div&gt;
        &lt;div class="XTSPSearchCell7"&gt;
          &lt;div class="XTSPSearchLabel"&gt;
            &lt;strong&gt;Stile di Viaggio: &lt;/strong&gt;
          &lt;/div&gt;
          &lt;div class="XTSPSearchField"&gt;&lt;select id="XTfield_temi" name="field_temi" id="XTfield_temi" class="temi SPSearchSelect"&gt;
      &lt;option value=""&gt; --- Select Stile di Viaggio  --- &lt;/option&gt;
      &lt;option value="stile_option_13"&gt;Luna di Miele&lt;/option&gt;
      &lt;option value="stile_option_12"&gt;Avventure&lt;/option&gt;
      &lt;option value="stile_option_11"&gt;Natura e Animali&lt;/option&gt;
      &lt;option value="stile_option_10"&gt;Deserto&lt;/option&gt;
      &lt;option value="stile_option_9"&gt;Cultura e Antiche Civiltà&lt;/option&gt;
      &lt;option value="stile_option_8"&gt;Spiaggia Mare e Relax&lt;/option&gt;
      &lt;option value="stile_option_7"&gt;Sott'Acqua&lt;/option&gt;
      &lt;option value="stile_option_6"&gt;On the Road&lt;/option&gt;
      &lt;option value="stile_option_5"&gt;Shopping nelle Grandi Città&lt;/option&gt;
      &lt;option value="stile_option_4"&gt;Mai più Soli&lt;/option&gt;
      &lt;option value="stile_option_3"&gt;Spa e Benessere&lt;/option&gt;
      &lt;option value="stile_option_2"&gt;Famiglie&lt;/option&gt;
  &lt;/select&gt; &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="spspacer" style="clear:both; margin-bottom: 10px;"&gt;&lt;/div&gt;
        &lt;div class="XTSPSearchCell8"&gt;
          &lt;div class="XTSPSearchLabel"&gt;
            &lt;strong&gt;Cerca nelle offerte: &lt;/strong&gt;
          &lt;/div&gt;
          &lt;div class="XTSPSearchField"&gt;&lt;div id="XTfield_offerte"&gt;
  &lt;div &gt;&lt;span&gt;
  &lt;!-- CheckBox 'field_offerte[]' Output --&gt;
  &lt;input type="checkbox" name="field_offerte[]" id="XTfield_offerte_field_offerte_option_1" value="field_offerte_option_1" class="XTSPSearchChbx" /&gt;
  &lt;label for="XTfield_offerte_field_offerte_option_1"&gt;Sì&lt;/label&gt;
  &lt;!-- CheckBox 'field_offerte[]' End --&gt;
  &lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="spspacer" style="clear:both;"&gt;&lt;/div&gt; &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="spspacer" style="clear:both; margin-bottom: 10px;"&gt;&lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="spspacer" style="clear:both;"&gt;&lt;/div&gt;
    &lt;div class="XTSPListing"&gt;
      &lt;div class="XTSPEntriesListContainer"&gt;&lt;/div&gt;
      &lt;div class="spspacer" style="clear:both;"&gt;&lt;/div&gt;
      &lt;div class="spspacer" style="clear:both;"&gt;&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div&gt;
  
  &lt;input type="hidden" id="XTSP_sid" name="sid" value="54"/&gt;
  &lt;input type="hidden" id="XTSP_task" name="task" value="search.search"/&gt;
  &lt;input type="hidden" id="XTSP_option" name="option" value="com_sobipro"/&gt;
  
              &lt;input type="hidden" id="sid_list132" name="sid_list" value=""/&gt;
                      &lt;input type="hidden" id="XTSP_Itemid" name="Itemid" value="101"/&gt;
      &lt;/div&gt;&lt;/div&gt;
  &lt;/form&gt;
  </code></pre>