I have many checkbox and other input like text,select ,textarea ,... in my form
I post all data of inputs but checkbox not post data
I saw this link
In Laravel 5.1 Can't post value of checkbox
But I do not want to use hidden button
Is there another way ?????
My form
<form id='test-form'>
<input name='text1'>
<input name='text2'>
<textarea name='text3'></textarea>
<input type="checkbox" name="test1" >
<input type="checkbox" name="test2" >
<input type="checkbox" name="test3" >
<input type="checkbox" name="test4" >
<input type="checkbox" name="test5" >
<input type="checkbox" name="test6" >
<input type="button" id='send'>
</form>
<script>
$(document).on("click", "#send", function () {
$.ajax({
type: 'post',
url: 'add',
data: $("#test-form").serialize(),
success: function (result) {
$('#ajax_div').html(result);
},
})
})
</script>