I am trying to return the values of all selected checkboxes through ajax. I cant work out how to pass the values through as a parameter.
HTML CHECKBOXES
<li><input class="customer_sales_value" id="customer_sales_1" type="checkbox" value="1"><label for="customer_sales_1">James</label></li>
<li><input class="customer_sales_value" id="customer_sales_2" type="checkbox" value="2"><label for="customer_sales_2">Jack</label></li>
<li><input class="customer_sales_value" id="customer_sales_3" type="checkbox" value="3"><label for="customer_sales_3">John</label></li>
<button id="customer_pop_share_btn">submit</button>
JQUERY
$('#customer_pop_share_btn').click(function(){
sales_list = each($('.customer_sales_value').val());
$.ajax({
type : 'POST',
url : '//'+base_url+'/ajax2/timeline-share.php',
data : 'sales_list='+sales_list,
success : function(data) {
});
});
My jquery is the issue, I think the way I want to do this is pass a list of the checkbox values into a variable like sales_list = 1,2,3 How do I do that?