I don\'t know how to pass the selected values of the checkboxes. Any help or suggestions will be a big help for me.
As of now here is my code I am stuck in passing th
Please try like this html:
" ?>
ajax/ jquery:
$(document).ready(function(){
//handle test button click
$("button#importSikep").click(function(){
var checkValues = $('input[name=chkimportsikep]:checked').map(function()
{
return $(this).val();
}).get();
alert(checkValues);
$('#loading-indicator-runsikep').show();
$.ajax({
type:"POST",
url:"runsikepimport.php", // your php page action
data:{ chkimportsikep: checkValues }, //
cache:false,
success: function(result){
$('#loading-indicator-runsikep').hide();
alert(result);
$('.modal.in').modal('hide');
$("#description-status-sikep").load(location.href + " #description-status-sikep");
//location.reload(true);
}
});
return false;
});
});
PHP action :
// don't need array variable, but your using $_POST
if(!empty($_POST['chkimportsikep'])) {
foreach($_POST['chkimportsikep'] as $table_name) {
// do something
}
}