Michelle Jackson
asked on
Sending Checkbox Status
Trying to send checkbox state to PHP page using Ajax. I am able to send he value of the element but I also need to send the state of the button that will determine if the data is added or deleted from the database. Here is what I have.
Thanks
<script>
$(document).on('click', '.favorite-resource-checkbox', function(){
var resourceValues = $( this ).val();
var user = "<?php echo $user_id; ?>";
var id = $(this).attr('id');
$.ajax({
url:"file.php",
method:"POST",
data:{value: resourceValues , user: user},
dataType:"text",
success:function(data)
{
alert(data);
}
})
});
</script>
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER