title: bootstrap-select get the value and the text
body: <p>I try to do a selections on companies to add to a group, and after that to do the connection in database. I'm kind of blocked on the "html" code. I work in Laravel</p>
  
  <pre><code>&lt;select id="selectCmp" class="selectpicker" data-live-search="true" multiple title="Select structures"&gt;
      @foreach($allCompanies as $company)
          &lt;option value="{{$company-&gt;id}}"&gt; {{$company-&gt;name}}&lt;/option&gt;
      @endforeach
  &lt;/select&gt;
  
  &lt;iframe name="votar" style="display:none;"&gt;&lt;/iframe&gt;
  
  &lt;form action={{route('admin.group.affect')}} method="POST" target = "votar"&gt;
      {{csrf_field()}}
      &lt;div id="cmpInputList"&gt;
  
      &lt;/div&gt;
      &lt;/br&gt;
      &lt;button id="addGroupeBtn" class="btn btn-secondary" type="submit"&gt;
          Add
      &lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Ok, if try to inspect the element, I have something like:</p>
  
  <pre><code>&lt;div class="btn-group bootstrap-select show-tick dropup"&gt;
      &lt;button type="button" class="btn dropdown-toggle btn-default" data-toggle="dropdown" role="button"
              data-id="selectCmp" title="Select structures" aria-expanded="true"&gt;&lt;span
              class="filter-option pull-left"&gt; Select structures&lt;/span&gt;&amp;nbsp;&lt;span class="bs-caret"&gt;&lt;span
              class="caret"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/button&gt;
      &lt;div class="dropdown-menu open" role="combobox" style="max-height: 560px; overflow: hidden; min-height: 142px;"&gt;
          &lt;div class="bs-searchbox"&gt;&lt;input type="text" class="form-control" autocomplete="off" role="textbox"
                                           aria-label="Search"&gt;&lt;/div&gt;
          &lt;ul class="dropdown-menu inner" role="listbox" aria-expanded="false"
              style="max-height: 504px; overflow-y: auto; min-height: 86px;"&gt;
              &lt;li data-original-index="0"&gt;&lt;a tabindex="0" class="" data-tokens="null" role="option"
                                             aria-disabled="false" aria-selected="false"&gt;&lt;span
                      class="text"&gt; A&lt;/span&gt;&lt;span class="glyphicon glyphicon-ok check-mark"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
              &lt;li data-original-index="1"&gt;&lt;a tabindex="0" class="selected" data-tokens="null" role="option"
                                             aria-disabled="false" aria-selected="true"&gt;&lt;span
                      class="text"&gt; B &lt;/span&gt;&lt;span class="glyphicon glyphicon-ok check-mark"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
              &lt;li data-original-index="2"&gt;&lt;a tabindex="0" class="" data-tokens="null" role="option"
                                             aria-disabled="false" aria-selected="false"&gt;&lt;span
                      class="text"&gt; C &lt;/span&gt;&lt;span class="glyphicon glyphicon-ok check-mark"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
  
          &lt;/ul&gt;
      &lt;/div&gt;
      &lt;select multiple="multiple" id="selectCmp" data-live-search="true" title="Select structures"
              class="selectpicker" tabindex="-98"&gt;
          &lt;option value="1"&gt; A&lt;/option&gt;
          &lt;option value="0"&gt;B&lt;/option&gt;
          &lt;option value="2"&gt; C&lt;/option&gt;
  
      &lt;/select&gt;
  &lt;/div&gt;
  
  &lt;iframe name="votar" style="display: none;"&gt;&lt;/iframe&gt;
  
  &lt;form action="http://127.0.0.1:8000/admin/affectCmpToGroup" method="POST" target="votar"&gt;
      &lt;input type="hidden" name="_token" value="KSyRBJq6p6yJBPJnv0EOsC2sJwEe2SbzjxtLtuI5"&gt;
      &lt;div id="cmpInputList"&gt;&lt;/div&gt;
      &lt;br&gt;
      &lt;button id="addGroupeBtn" type="submit" class="btn btn-secondary"&gt;
          Add
      &lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>So I have a <code>ul</code> with the <code>innerText</code> and mention about selected or not. My problem is how to give the <code>innerText</code> and the value from option (the id) to the form in order to pass that to controller and to database.</p>
  
  <p>I hope it's clear... I'm kind of new in all this.</p>