Shilyaev Posted November 23, 2016 Share Posted November 23, 2016 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> Quote Link to comment https://forums.phpfreaks.com/topic/302602-sending-data-using-jqueryajax/ Share on other sites More sharing options...
codefossa Posted November 27, 2016 Share Posted November 27, 2016 $('#checkboxes input').change(function () { /* Your stuff */ }); Quote Link to comment https://forums.phpfreaks.com/topic/302602-sending-data-using-jqueryajax/#findComment-1539724 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.