I want to insert multiple chips at a time in the database.
Here is my add task page, and there is one select field. If I select the checkbox then another field is visible. To enter the chips I can enter multiple chips for one select box. How do I enter these chips into the database?
And also I want to show these chips to users in form of a checkbox. If I use the checkbox in the select box and enter multiple chips then those multiple chips become checkboxes on the user side. How can I do this?
<div class="col-md-12 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<h4 class="card-title">Add Task</h4>
<form class="forms-sample" action="{{ route('store.task', $checklist->id) }}" method="POST">
@csrf
<div class="form-group">
<label for="exampleInputUsername1">Task Name</label>
<input name="name" type="text" class="form-control" id="name" required>
<span id="task" class="text-danger"></span>
@error('name')
<span class="text-danger">{{ $message }}</span>
@enderror
</div>
<div class="form-group">
<label for="exampleTextarea1">Description</label>
<textarea name="description" class="form-control" name="summernote" id="summernote1" required></textarea>
</div>
@error('description')
<span class="text-danger">{{ $message }}</span>
@enderror
<div class="row">
<div class="col-md-6">
<select class="form-control" id="select" required>
<option disabled="" selected="">--Select Option--</option>
<option value="text">Text</option>
<option value="textarea">Text Area</option>
<option value="checkbox">Check Box</option>
<option value="radio">Radio</option>
</select>
</div>
<div class="col-md-6">
<input name="name" type="text" class="form-control" id="name1" style="display: none">
<textarea name="description" class="form-control" id="textbox" style="display: none"></textarea>
<div class="chips" id="chips" style="display: none">
<input class="custom-class">
</div>
<div class="chips" id="chips1" style="display: none">
<input class="custom-class">
</div>
</div>
</div>
<button name="submit" type="submit" class="btn btn-primary mr-2">Add</button>
</form>
</div>
</div>
</div>
And my task table contains the following fields: id, name, description, and checklist_id
Which field should I add and how can I insert these chips in the database and show them in form of checkboxes?