This snippet is based on two fields: a check box called entry_is_public, and a text field called field_to_change. Basically when you click the checkbox, prototype checks to see if its checked, and depending on the answer will enable or disable another element. This can be handy for things like making sure a user accepts a terms of service before hitting a button.
check_box('entry', 'is_public', :onClick => "$('field_to_change').disabled = $('entry_is_public').checked ? true : false;")