title: multiple dropdowns using the same jquery function
body: <p>I have this other issue where  I have multiple dropdowns which have the same jquery function. When  I select the 1st  project dropdown the the corresponding  task dropdown gets selected. But when i have multiple dropdown only the first task drop down gets selected.  when there are multiple dropdowns when the project is selected in the dropdown i want the corresponding task dropdown to be updated.</p>
  
  <p>My Task dropdown look like this</p>
  
  <pre><code> &lt;select id="task_id" name="tasks_id[]" size="8" multiple="1"&gt;
      &lt;optgroup label="01 CONSULT" &gt;
        &lt;option value="1"&gt;1a Rules&lt;/option&gt;
        &lt;option value="2"&gt;1b Vacation&lt;/option&gt;
        &lt;option value="3" &gt;1c Meetings&lt;/option&gt;
     &lt;/optgroup&gt;
     &lt;optgroup label="02 SALES" &gt;
        &lt;option value="12"&gt; 2c Internal&lt;/option&gt;
        &lt;option value="13"&gt; 2d External &lt;/option&gt;
     &lt;/optgroup&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p><strong>Html code</strong></p>
  
  <pre><code> &lt;%= select_tag "task_id[]", options_from_collection_for_select([unspecified_task], 'id', 'name', entry.task_id || unspecified_task.id) + grouped_options_for_select(active_task_options, entry.task_id.to_s) %&gt;
  </code></pre>
  
  <p>I want to know how to write the jquery so that when their are multiple dropdowns and a project is selected the corresponding task drop down will be populated.</p>