jquery multiple checkboxes array
var checked = []
$("input[name='options[]']:checked").each(function ()
{
checked.push(parseInt($(this).val()));
});
var checkedString = $('input:checkbox:checked.name').map(function() { return this.value; }).get().join();
You can use $.map()
(or even the .map()
function that operates on a jQuery object) to get an array of checked values. The unary (+) operator will cast the string to a number
var arr = $.map($('input:checkbox:checked'), function(e,i) {
return +e.value;
});
console.log(arr);
Here's an example
If you have a class for each of your input box, then you can do it as
var checked = []
$('input.Booking').each(function ()
{
checked.push($(this).val());
});