I currently have a form with two checkboxes corresponding to each question in which I'm trying to get all the values from all the checked checkboxes and store them into an "answers" array. I will then use this answers array in my POST request to store the answers in my database.
Although I'm having trouble achieving this, my form currently looks like this, with the options coming dynamically from my database.
<form class="quiz-form">
<div *ngFor="let option of quiz">
<label> : </label>
<input type='checkbox' name='checkbox'/>
<label> </label>
<input type='checkbox' name='checkbox'/>
<label> </label>
</div
<button type="submit" value="Submit"> Complete quiz </button>
</form>
Can anyone help me achieve this? Thanks.
Aucun commentaire:
Enregistrer un commentaire