• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

onkeyup

Explorer ,
Oct 02, 2013 Oct 02, 2013

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" />

Views

530

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Oct 02, 2013 Oct 02, 2013

Copy link to clipboard

Copied

LATEST

You probably want to use onchange instead of onkeyup with checkboxes, as checkboxes have no text input to evaluate keypresses against.

-Carl V.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation