Skip to navigation
Get the checkbox status from form element by clicking it and send an ajax request
04.12.15
jQuery('body').on('click','.class_name',function(e) { var obj = jQuery(this); var doc_id = obj.val(); var checked = obj.prop('checked'); var user_id = obj.attr('data-user_id'); jQuery.ajax({ url:data.base_url + "checkouts/ajax_update_doc/", type:'POST',data:{'doc_id':doc_id, 'user_id':user_id, 'checked':checked }, success:function(res) { if(res.success == true) { var url = data.base_url + "checkouts/index/en/" + new Date().getTime() window.location.href=url; } } });
http://www.w3schools.com/ajax/default.asp
Reply
Anonymous
Information Epoch 1732592111
Portable data is as important as portable code.
Home
Notebook
Contact us