I've got the following script:
jQuery('.checkbox-for-accept').click(function(){
var value= jQuery(this).is(':checked');
jQuery.ajax({
url: '',
type: 'POST',
data: {check:value},
success: function(data){
alert(data);
}
});
});
However, when clicking the checkbox nothing seems to happen (no alert, nothing). I've tried to find solutions in numerous places by now, and just can't seem to figure out, what is wrong.
My goal is to send it to the current page, which is why i have left the url blank (i read that somewhere, that was how i should do it).
I simply can't figure out, what I've done wrong?
as a note: i've also found numerous questions and answers in here, regarding something similar, but nothing has helped me so far.
Edit 1: completely forgot the relevant HTML as pointed out. The click event is for a checkbox to see whether the checkbox is checked or not. The checkbox is used to accept terms of use before allowing a download.
<input type="checkbox" id="checkbox1" class="checkbox-for-accept" name="checkbox" value="acceptchecked" />