mercredi 16 novembre 2022

Want to make checkboxes in the dropdown list?

Currently, I have dropdown list and 1-25 values in dropdown. Current one is I want to make checkbox for those values instead of choosing multiple. Is there anyway to add checkbox for those?

    var mtf = document.getElementById('affectedwaferid').selectedOptions;
  var affectedwf = Array.from(mtf).map(({ value }) => value);
  //alert(affectedwf);
  document.getElementById("selected-result").innerHTML = affectedwf; 

Above is JavaScript.

<div id="afwid">
  <label class="control-label col-sm-4" for="affectedwaferid" style="margin-left: 1px;">Affected Wafer ID : <span id="selected-result"></span></label>
       <div class="col-sm-4">
        <p class="form-control-static" style="margin-top: -6px;">
            
            <select class="form-control" id="affectedwaferid" name="affectedwaferid" multiple>
            <option value="" selected > Select Quantity</option>
            <?php  
            //echo $cbo_oorigsite;
            ?>
            <option value="1">1</option>
              <option value="2">2</option>
              <option value="3">3</option>
              <option value="4">4</option>
              <option value="5">5</option>
              <option value="6">6</option>
              <option value="7">7</option>
              <option value="8">8</option>
              <option value="9">9</option>
              <option value="10">10</option>
              <option value="11">11</option>
              <option value="12">12</option>
              <option value="13">13</option>
              <option value="14">14</option>
              <option value="15">15</option>
              <option value="16">16</option>
              <option value="17">17</option>
              <option value="18">18</option>
              <option value="19">19</option>
              <option value="20">20</option>
              <option value="21">21</option>
              <option value="22">22</option>
              <option value="23">23</option>
              <option value="24">24</option>
              <option value="25">25</option>

          </select>
        </p>
      </div>



Aucun commentaire:

Enregistrer un commentaire