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

onkeyup

Explorer ,
Oct 02, 2013 Oct 02, 2013

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

572
Translate
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
LATEST

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

-Carl V.

Translate
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