how to pass value from fieldset select option to fieldset checkbox
<p>I'm still new to Javascript and Jquery and am having a little trouble with this one.</p>

<p>I want to be able to pass a value from a fieldset (#a) with a select option to another fieldset (#b) with checkbox options.  For example, the fieldset #a has default options 1,2,3,4,5.   Fieldset #b can have many more options but must at least include the default from #a.</p>

<p>code snippet for fieldset #a:</p>

<pre><code>      &lt;fieldset id="a"&gt;
        &lt;legend&gt;&lt;span&gt;Default Option&lt;/span&gt;&lt;/legend&gt;  
        &lt;div class="fieldset_wrapper"&gt;
          &lt;select name="form_default"&gt;
            &lt;option value=""&gt;Select One&lt;/option&gt;
            &lt;%=returnValueMap.get("defaultOptionSelect")%&gt;

          &lt;/select&gt;
        &lt;/div&gt;
      &lt;/fieldset&gt;
</code></pre>

<p>code snippet for fieldset #b:</p>

<pre><code>         &lt;fieldset id="b"&gt;
         &lt;legend&gt;&lt;span&gt;Option&lt;/span&gt;&lt;/legend&gt;
            &lt;div class="fieldset_wrapper"&gt;
              &lt;div&gt;&lt;input type="checkbox" name="select-all" id="select-all" class="checkAll"/&gt;   All Options&lt;/div&gt;

        &lt;%=returnValueMap.get("optionSelect")%&gt;

        &lt;/div&gt;
      &lt;/fieldset&gt;
</code></pre>

<p>Edit, here is something I tried but I think I'm obviously missing something. Again, i'm trying to learn this stuff</p>

<pre><code>    $('#a option[name="form_default"]:selected').each(function(){   
                            $('#b input[type="checkbox"]').eq($(this).index()).prop('checked',true);
    });
</code></pre>
