Checkboxes in Prototype

observing:
$(‘mycheckbox’).observe(‘click’, function(e){alert(‘checked = ‘ + this.checked);});

setting throught scripting:
$(‘mycheckbox’).checked = true;
$(‘mycheckbox’).setAttribute(‘checked’, true);
$(‘mycheckbox’).setValue(”); // will un-check/null value
$(‘mycheckbox’).setValue(‘anything’); // will check/on value
$(‘mycheckbox’).click(); // will toggle the checkbox

  1. Outstanding. It helped me build a lot more flexibility into my prototype boxes. Thanks

  2. Thanks for the great tips.

  3. I came across. Thank you.

Leave a Comment