Hello,
I've created a form that has several checkboxes and then some questions related to the checkboxes. What I would like is for the related questions to be hidden until the checkbox is selected, then the addition questions for - that check box only - would appear. Is this something that can be done in javascript and can someone help me figure out how to build it?
Here's what I have so far:
<code>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Badgering</title>
<script type="text/javascript" src="jquery-1.2.6.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
//Hide div w/id extra
$("#extra").css("display","none");
// Add onclick handler to checkbox w/id checkme
$("#checkme").click(function(){
// If checked
if ($("#checkme").is(":checked"))
{
//show the hidden div
$("#extra").show("fast");
}
else
{
//otherwise, hide it
$("#extra").hide("fast");
}
});
});
</script>
<style type="text/css">
<!--
label {
display: block;
}
-->
</style>
</head>
<body>
<form>
<table>
<tr><td class=m><label for "Badgering">Badgering</label></td>
<td class=m><input type=checkbox size=10 name=_fid_12 />
<div id="extra">
<table>
<tr>
<td width="15"></td>
<td width="85">Timestamp(s)</td>
<td class="m" width="288"><input type="text" size="40" name="_fid_28"></td>
</tr>
</table>
</td>
</tr>
</div>
</table>
</form>
</body>
</html>
</code>
Thanks,
Lori
