title: Multiple select option
body: <p>I have two select box one select box is multiple select option, there is an add more button to add multiple rows with same selectboxs, the values are passed in array format, i want to print each row multiple select options.</p>
  
  <pre><code>------------------------------------------------------------------
       Select1   |        Select2     |         Textbox
  ------------------------------------------------------------------
  Option1                Option1                      
  Option2                Option2
  Option3                Option3
  Option4                Option4
  </code></pre>
  
  <p>I select first option in first select box and second select box multiple options select(Option1 and Option2), in second row i select second option in first select box and second select box multiple options select(Option3 and Option4).
  I click on submit button i want to print </p>
  
  <pre><code>Option1             Option1
  Option1             Option2
  
  Option2             Option3
  Option2             Option4
  </code></pre>
  
  <p>but now it print (takes all data from the multiple select box)</p>
  
  <pre><code>Option1             Option1
  Option1             Option2
  Option1             Option3
  Option1             Option4
  
  Option2             Option1
  Option2             Option2
  Option2             Option3
  Option2             Option4
  </code></pre>
  
  <p><strong>Here is my code :</strong> </p>
  
  <pre><code>&lt;div id="lobrows"&gt;
          &lt;div class="form-group"&gt;
              &lt;div class="col-sm-4"&gt;&lt;label&gt;Reson&lt;/label&gt;
                  &lt;select class="form-control selectpicker" data-live-search="true" name="reson[]" required="required"&gt;
                      &lt;option&gt;--Select--&lt;/option&gt;
                  &lt;option value="1"&gt;List 1&lt;/option&gt;
                  &lt;option value="2"&gt;List 2&lt;/option&gt;
                  &lt;option value="3"&gt;List 3&lt;/option&gt;
                  &lt;option value="4"&gt;List 4&lt;/option&gt;
                  &lt;/select&gt;
              &lt;/div&gt;
              &lt;div class="col-sm-4"&gt;&lt;label&gt;Service &lt;/label&gt;
                  &lt;select class="form-control selectpicker" data-live-search="true" name="service[]" id="service" multiple="multiple"&gt;
                      &lt;option&gt;--Select--&lt;/option&gt;
                      &lt;option value="1"&gt;List 1&lt;/option&gt;
                      &lt;option value="2"&gt;List 2&lt;/option&gt;
                      &lt;option value="3"&gt;List 3&lt;/option&gt;
                      &lt;option value="4"&gt;List 4&lt;/option&gt;
                  &lt;/select&gt;
              &lt;/div&gt;
              &lt;div class="col-sm-4"&gt;&lt;label&gt;Name &lt;/label&gt;
                  &lt;input type="text" class="form-control" name="name[]" placeholder="Name" /&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;a href="#" class="pull-right" id="add"&gt;&lt;i class="fa fa-plus"&gt;&lt;/i&gt;&amp;nbsp;add&lt;/a&gt;
  
  &lt;script type="text/javascript"&gt;
      $(document).ready(function() {
          $('#add').click(function(e) {
              e.preventDefault();
              var i=$('.mrbtm').length+1;
              $('#lobrows').append('&lt;div class="mrbtm"&gt;&lt;div class="form-group"&gt;&lt;div class="col-sm-4"&gt;&lt;label&gt;Reson &lt;/label&gt;&lt;select class="form-control selectpicker" data-live-search="true" name="reson[]"&gt;&lt;option&gt;--Select--&lt;/option&gt;&lt;option value="1"&gt;List 1&lt;/option&gt;
                  &lt;option value="2"&gt;List 2&lt;/option&gt;
                  &lt;option value="3"&gt;List 3&lt;/option&gt;
                  &lt;option value="4"&gt;List 4&lt;/option&gt;&lt;/select&gt;&lt;/div&gt;&lt;div class="col-sm-4"&gt;&lt;label&gt;Service &lt;/label&gt;&lt;select class="form-control selectpicker" data-live-search="true" name="service[]" id="service'+i+'" multiple="multiple"&gt;&lt;option&gt;--Select--&lt;/option&gt;&lt;option value="1"&gt;List 1&lt;/option&gt;&lt;option value="2"&gt;List 2&lt;/option&gt;&lt;option value="3"&gt;List 3&lt;/option&gt;&lt;option value="4"&gt;List 4&lt;/option&gt;&lt;/select&gt;&lt;/div&gt;&lt;div class="col-sm-4"&gt;&lt;label&gt;Name &lt;/label&gt;&lt;input type="text" class="form-control" name="name[]" placeholder="Name" required="required" /&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href="#" class="pull-right remove"&gt;&lt;i class="fa fa-minus"&gt;&lt;/i&gt; Remove&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;');
              $('.selectpicker').selectpicker();
              $('.selectpicker').selectpicker('refresh');
          });
          $(document).on('click', '.remove', function(e) {
              e.preventDefault();
              $(this).parent('div').remove();
              i--;
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>Here is my PHP Code :</strong></p>
  
  <pre><code>&lt;?php
  foreach ($reson as $id =&gt; $value) {
      $reson = ($reson[$id]);
      $namep = ($name[$id]);
  
  
      foreach ($service as $ii =&gt; $valu) {
          $r_service = ($service[$ii]);
          echo "Option".$reson."----"."Option".$r_service ."&lt;br&gt;";
      }
  }
  ?&gt;
  </code></pre>