Create a form with an id of "myform" (at least that is for this example). And create a div with an id of "myhide".
Code:
//show the div:
document.getElementById('myhide').style.display = "block";
//hide the div:
document.getElementById('myhide').style.display = "none";
//clear the form:
document.getElementById('myform').reset();
Of course you will need to apply those in the right locations. If you're using a checkbox, then you can apply the code using onchange="showhide();"
Here's the function for showhide(). Place this in your head section.
Code:
<script type="text/Javascript">
function showhide() {
if (document.getElementyById('myhide').style.display = "none") {
//show the div:
document.getElementById('myhide').style.display = "block";
}
else {
//hide the div:
document.getElementById('myhide').style.display = "none";
//clear the form:
document.getElementById('myform').reset();
}
}
</script>
Bookmarks