lundi 26 juin 2017

(jquery, laravel, html) code change from multiple select to checkbox select

I want to change from multiple select to checkbox select.

original code is this.

<form action="" method="POST" enctype="multipart/form-data" class="form__article">
{!! csrf_field() !!}

<div class="form-group ">
  <label for="tags"></label>
  <select name="tags[]" id="tags" multiple="multiple" class="form-control" >
    @foreach($allTags as $tag)
      <option value="">
        
      </option>
    @endforeach
  </select>
  {!! $errors->first('tags', '<span class="form-error">:message</span>') !!}
</div>

....

</form>

I tried this code, but don't work. I think the type of result is different...

<form action="" method="POST" enctype="multipart/form-data" class="form__article">
{!! csrf_field() !!}
<div class="form-group ">
  <label for="tags"></label>
  <div name="tags[]" id="tags" multiple="multiple" class="form-control" >
      @foreach($allTags as $tag)
      <input type="Checkbox" name="" value="">
      @endforeach
  {!! $errors->first('tags', '<span class="form-error">:message</span>') !!}
</div>

....

</form>

I need your advise. thank you.




Aucun commentaire:

Enregistrer un commentaire