Thursday, April 13, 2017

How to get values of checkbox array in Laravel 5?

I created checkboxes in form using javascript:

<input type="checkbox" name="is_ok[]" />
<input type="checkbox" name="is_ok[]" />
<input type="checkbox" name="is_ok[]" />

When I check 1st and 3rd checkbox and submit the form, Input::get("is_ok") returns me:

['on', 'on']

Is there any way to get value as ['on', null, 'on'] or ['on', 'off', 'on']?

Thanks in advance.



via aikutto

Advertisement