add multiple values to array in select box
===

I have the below working based on the accepted answer in [this question][1].

see [this link][2] for how this works

    <form action="" name="testform" method="post" id="testform">
    <div id='div_block1'>
    <input type="text" value="" name="a[]" class='input_text'>
    <input type="text" value="" name="b[]" class='input_text'>
    <input type="text" value="" name="c[]" class='input_text'>
    <select id='block1'>
        <option value="" data-value=""></option>
        <option value="1" data-value="11,12,13">1</option>
        <option value="2" data-value="21,22,23">2</option>
        <option value="3" data-value="31,32,33">3</option>
        <option value="4" data-value="41,42,43">4</option>
        <option value="5" data-value="51,52,53">5</option>
    </select>     
    </div>
    <div id='div_block2'>        
    <input type="text" value="" name="a[]" class='input_text'>
    <input type="text" value="" name="b[]" class='input_text'>
    <input type="text" value="" name="c[]" class='input_text'>
    <select id='block2'>
        <option value="" data-value=""></option>
        <option value="1" data-value="11,12,13">1</option>
        <option value="2" data-value="21,22,23">2</option>
        <option value="3" data-value="31,32,33">3</option>
        <option value="4" data-value="41,42,43">4</option>
        <option value="5" data-value="51,52,53">5</option>
    </select>     
    </div>
    </form>
    <script>
    $(function() {
    $('select').on('change', function() {
        var div_id = 'div_'+$(this).attr('id');
        var select_val = $(this).find('option:selected').data('value');
        console.log();
            if( select_val != '' ) {
                var a = select_val.split(',');
                $('div#'+div_id+' input[name="a[]"]').val(a[0]);
                $('div#'+div_id+' input[name="b[]"]').val(a[1]);
                $('div#'+div_id+' input[name="c[]"]').val(a[2]);
            } else {
                $('div#'+div_id+' input.input_text').val('');
                }
        });
    });    
    </script>

I want to change it up slightly so that if I select 1 for example I get two values for a[], b[], c[]

I have done the below

    <form action="" name="testform" method="post" id="testform">
    <div id='div_block1'>
    <input type="text" value="" name="a[]" class='input_text'>
    <input type="text" value="" name="b[]" class='input_text'>
    <input type="text" value="" name="c[]" class='input_text'>
    <input type="text" value="" name="a[]" class='input_text'>
    <input type="text" value="" name="b[]" class='input_text'>
    <input type="text" value="" name="c[]" class='input_text'>        
    <select id='block1'>
        <option value="" data-value=""></option>
        <option value="1" data-value="11,12,13,6,12,8">1</option>
        <option value="2" data-value="21,22,23,8,10,33">2</option>
        <option value="3" data-value="31,32,33,2,8,6">3</option>
        <option value="4" data-value="41,42,43,22,54,63">4</option>
        <option value="5" data-value="51,52,53,12,34,55">5</option>
    </select>     
    </div>
    <div id='div_block2'>        
    <input type="text" value="" name="a[]" class='input_text'>
    <input type="text" value="" name="b[]" class='input_text'>
    <input type="text" value="" name="c[]" class='input_text'>
    <input type="text" value="" name="a[]" class='input_text'>
    <input type="text" value="" name="b[]" class='input_text'>
    <input type="text" value="" name="c[]" class='input_text'>
    <select id='block2'>
        <option value="" data-value=""></option>
        <option value="1" data-value="11,12,13,95,44,32">1</option>
        <option value="2" data-value="21,22,23,12,35,51">2</option>
        <option value="3" data-value="31,32,33,21,12,24">3</option>
        <option value="4" data-value="41,42,43,35,52,15">4</option>
        <option value="5" data-value="51,52,53,23,42,15">5</option>
    </select>     
    </div>
    </form>    


 [see fiddle][3].  From my understanding of how the first one worked I thought this would work however it is only taking the last value for a[], b[], c[]  eg 6,12,8,6,12,8 instead of 11,12,13,6,12,8 if you select 1.

What else do I need to add to get this working as desired?


  [1]: http://stackoverflow.com/questions/11612639/add-value-to-form-array-on-click
  [2]: http://jsfiddle.net/aaronk85/SDCkW/
  [3]: http://jsfiddle.net/aaronk85/SDCkW/2/