Copy link to clipboard
Copied
Hi,
Why it's not working with checkbox? If I change the type ="checkbox" to type="text" the it worked, meaning the radio button is enabled.
Thanks
<script type="text/javascript">
function EnableTextBox(sender, target, maxcar) {
if ( sender.value.length >= maxcar )
document.getElementById(target).disabled = false;
else {
document.getElementById(target).disabled = true;
document.getElementById(target).value = '';
}
}
//onchange from dropbox diffrent status
function gotourl(url){
window.location= url;
}
</script>
<cfinput type="checkbox" name="prize" id="prize" value="1" disabled="disabled" onkeyup="EnableTextBox(this, 'completed', 1);">
<cfinput type="radio" name="completed" disabled="disabled" value="1" />
Copy link to clipboard
Copied
You probably want to use onchange instead of onkeyup with checkboxes, as checkboxes have no text input to evaluate keypresses against.
-Carl V.