I need send via AJAX data like the following:
<tr>
<td><input type="textbox" value="12" name="delay[256]"></td>
<td><input type="checkbox" value="256" name="attach_to[]"></td>
</tr>
<tr>
<td><input type="textbox" value="7" name="delay[653]"></td>
<td><input type="checkbox" value="653" name="attach_to[]"></td>
</tr>
Which is the best way to encode these 2 types of input?
$.post(
window.location.href,
{
data_ajax: 1,
attach_to : attach_to, // how encode?
delay: delay // how encode?
},
function(array) {
},
'json'
);
OBS: I only want send these data and not the entire form. So .serialize() seems not adequate.