How can I toggle the visibility of elements?

If you work with the Prototype Javascript Framework (you need this framework if you want to use the Ajax functionality of CakePHP), it is very easy to toggle the visibility of elements. A simple example:

<?php echo $html->checkbox(‘MyCheckbox’, null, array(‘onclick’ => “Element.toggle(‘message’);”)); ?>
<div id=”message” style=”display: none;”>
Checkbox is selected.
</div>

Post a Comment

Required fields are marked *
*
*

%d bloggers like this: