This is (for your purposes) probably an oversimplification and not as flexible as you might want, but it shows the basic idea:
Code:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
label {
display: block;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript">
document.write(['<style type="text/css">',
'.slider { display: none; }',
'</style>'].join(''));
jQuery(function($){
function triggers(){
var slider = $('#' + $(this).attr('data-trigger')).stop(true, true);
this.checked? slider.slideDown() : slider.slideUp();
}
$('*[data-trigger]').click(triggers).each(triggers);
});
</script>
</head>
<body>
<form>
<label>See Section One: <input type="checkbox" data-trigger="section_1"></label>
<div class="slider" id="section_1">
<label>Name: <input type="text" name="name"></label>
</div>
<label>See Section Two: <input type="checkbox" data-trigger="section_2"></label>
<div class="slider" id="section_2">
<label>Password: <input type="password" name="password"></label>
</div>
</form>
</body>
</html>
I'm pretty sure you will have questions. Feel free to ask.
Bookmarks