I have a checkbox I wanting to show a fieldset in a form dependent on whether or not the checkbox is clicked or not? i.e if the checkbox is checked don't show the fieldset and if it is not show the fieldset.
My markup looks like this,
<fieldset class="toplined">
<label>Keep Image</label>
<input type="checkbox" name="update_image[]" value="1" id="toggle" checked='true'/>
</fieldset>
<fieldset class="toplined toggle_slide">
<label>Image:</label>
<input type="file" name="article_image[]">
</fieldset>
the fieldset with the class toggle_slide is the one I want to show/hide, I currently have this mootools script
$('toggle').addEvent('click', function(e){
e = new Event(e);
$$('.toplined toggle_slide').toggle();
e.stop();
});
however this just results in errors.
try
document.getElement("fieldset.toplined.toggle_slide").toggle();