I want to direct the user to another page when they check a checkbox. This is what I tried.
<input type="checkbox" name="cheque_status" value="0" id="chequeList" onclick="myfunc()"/>
<iframe style="display:none;">
<script>
function myfunc(){
if(document.getElementById("chequeList").checked= true) {
location.href = "/index.cfm";
}
}
</script>
</iframe>
Basically what I am trying to do is, if there is any onclick on the checkbox, then it should redirect users to that index.cfm page. However, it doesn't work for me.
What am I doing wrong? Please help.
Thank you.
= truein your test. It's an assignment, not a comparison.