dimanche 6 décembre 2015

How to get all checkboxs and store them by id

I have some checkboxs, now I would like to get all of checkboxs and ids.

for example :

<input name="sizes" id="1" type="checkbox" checked="{{$check}}">
<input name="sizes" id="2" type="checkbox" checked="{{$check}}">
<input name="sizes" id="3" type="checkbox" checked="{{$check}}">
<input name="sizes" id="4" type="checkbox" checked="{{$check}}">
<input name="sizes" id="5" type="checkbox" checked="{{$check}}">

what I want :

//array :::  id:status -> status : 0:unchecked 1:checked

1=>0
2=>1
3=>1
4=>0
5=>1

I want to post this array by Ajax .

Aucun commentaire:

Enregistrer un commentaire