title: Remember selected options from search module select list
body: <p>I've got a search form, with multiple select lists.
  I need to remember it the last selections of user, and set it as "default" values in the next page.
  I'm using the Jquery Cookie Plugin, but it remembers only one selection for one list only.
  How can i remember all selections?
  It is an example form:</p>
  
  <pre><code>    &lt;form action="/component/sobipro/" method="post" id="XTspSearchForm141" &gt;
      &lt;input type="submit" id="XTtop_button" name="search" value="Search" class="button" onclick="this.form.sp_search_for.focus();extSearchHelper141.extractFormValues();"/&gt;
      &lt;select id="XTfield_localita" name="field_localita" class="XTSPSearchSelect" &gt;
      &lt;option value=""&gt; --- Seleziona Località  --- &lt;/option&gt;
      &lt;optgroup label="Italy"&gt;
      &lt;option value="localita_option_1"&gt;Rome&lt;/option&gt;
      &lt;/optgroup&gt;
      &lt;optgroup label="France"&gt;
      &lt;option value="localita_option_2"&gt;Paris&lt;/option&gt;
      &lt;/optgroup&gt;
      &lt;/select&gt;
      &lt;select id="XTfield_stile" name="field_stile" class="XTSPSearchSelect" &gt;
  &lt;option value=""&gt; --- Seleziona Stile  --- &lt;/option&gt;
      &lt;option value="stile_option_1"&gt;Arte&lt;/option&gt;
      &lt;option value="stile_option_2"&gt;Business&lt;/option&gt;
      &lt;/select&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>This is the script:</p>
  
  <pre><code>&lt;script text= type='text/javascript'&gt; 
  
  jQuery(function() {
  
      jQuery('XTspSearchForm141').submit(function(e) {
           if (jQuery.cookie('my_cookie') ) { jQuery.cookie( 'my_cookie', null) }
          jQuery.cookie('my_cookie', 'my_value', { expires: 30 });
      });
  });
  
  &lt;/script&gt;
  
  
  &lt;script text= type='text/javascript'&gt; 
  
  var $c = jQuery.noConflict();
  //checks if the cookie has been set
  if($c.cookie('remember_select') != null) {
  // set the option to selected that corresponds to what the cookie is set to
  $c('.XTSPSearchSelect option[value="' + $c.cookie('remember_select') + '"]').attr('selected', 'selected');
  }
  // when a new option is selected this is triggered
  $c('.XTSPSearchSelect').change(function() {
  // new cookie is set when the option is changed
  $c.cookie('remember_select', $c('.XTSPSearchSelect option:selected').val(), { expires: 90, path: '/'});
  });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Any ideas?</p>