I have a <a> link and a checkbox, I want to redirect to the href only if the javascript returns true (the box is checked)
Here is my code :
My javascript file :
function fb_checkbox() {
if (document.getElementById("checkAGB").checked == false) {
document.getElementById('notAccepted').style.display = "block";
return false;
}else{
return true;
}
In my PHP file :
<a href="'.$loginUrl.'" onclick="fb_checkbox();">Sign in with Facebook</a>