mardi 29 août 2017

Checkbox not completing completing function html javascript

I have multiple check boxes in my webpage. Each checkbox runs a javascript function called "adds". This works when you click the box manually.

I have another type of checkbox which checks all the check boxes in that div, but when this is checked it does not run the function "adds" on the checkboxes it checks.

Does anyone know why?

Check all in div function:

<script type="text/javascript" language="javascript">
function checkCheckboxes( id, pID ){
$('#'+pID).find(':checkbox').each(function(){
jQuery(this).prop('checked', $('#' + id).is(':checked'));
});  
}
</script>

Adds Function:

<script type="text/javascript" language="javascript">
function adds(id) {

var value = $(id).val()

    jQuery.ajax({
        url: "selection_update.php",
        data: {"value": value},
        type: "POST",
        dataType: 'json',
            success:function(responce){
            $("#check").html(responce);
        }
    });
}
</script>




Aucun commentaire:

Enregistrer un commentaire