How can I send all the checked item into php using AJAX. The info I expect to send including checkbox id and checkbox inner text. e.g. If I check box1 and box2, it could save the useful info into Data then sent to php when I click submit.
I try to use serialize()
in javascript, however the Date has always been "".
var Data = $('#myform').serialize();
Please notice that I don not expect realtime respond when I check each box. I just wanna send the entire checked list after I click "submit".
<form class="myform" id="myform" action="add.php">
<input type="checkbox" class="checkBox[]" id="1"> 1
<input type="checkbox" class="checkBox[]" id="2"> 2
<input type="checkbox" class="checkBox[]" id="3"> 3
<input type="submit" class="add" id="add" name="add">
<form>