vendredi 18 janvier 2019

How Send Multi Values from checkbox using Ajax & php? [duplicate]

This question already has an answer here:

i Have a Multi Checkboxs inputs and i want to send the value of each one in database but when i click in any checkbox the same value have send

"; }

    function add_multi_absences() {
        var students_token =  $("#students_token").val();
        // AJAX code to send data to php file.
        $.ajax({
            type: "POST",
            url: "include/ajax/add_multi_absences.php",
            data: {
                students_token:students_token
            },
            beforeSend: function () {
             $(".loader").fadeIn();
             $(".showing").fadeIn();
            },
            success: function(data) {
             $(".resultshowing").fadeIn().html(data);
            },
            error: function(err) {
            alert(err);
            },
           complete: function() {
                $('.loader').fadeOut();
            }
        });
}

</script>




Aucun commentaire:

Enregistrer un commentaire