I've wrote code for sending array to another php file with mysql, everything works, but but i can't add CHANGE function to my code, to make code react on changes (checked/uchecked checkbox)
<div id="checkboxes">
<input id="chkbx_0" type="checkbox" name="first" checked="checked" />Option 1
<input id="chkbx_1" type="checkbox" name=second" />Option 2
<input id="chkbx_2" type="checkbox" name="third" />Option 3
<input id="chkbx_3" type="checkbox" name="fourth" checked="checked" />Option 4
</div>
<script>
$(document).ready(function () {
//
var name = [];
$('#checkboxes input:checked').each(function() {
name.push($(this).attr('name'));
}).get();
//
$.post('load.php', {name:name[1]}, function(data){
$('#name-data').html(data);
});
//
});
</script>