Here is the code:
The problem code is in red. When the box is checked, the section should expand and when it's unchecked the section should contract. It contracts fine, but when it expands, everything in the section disappears. Help!
Keith Davis
MCSA, A+, N+, Guru+, Geek+, Child of God++++++
Love and Service
Code:
<div class="bluebox" id="assessmentinstruments" style="height: 50px; overflow: hidden"> <span style="position: absolute">
<input type="CHECKBOX" name="ai_section" value="*" class="radiocheck" id="ai_section">
*
[COLOR=#ff0000]
<script>
function Section($sCheck, $sID){
if($($sCheck).checked == false){
$($sID).style.height = '50px';
$($sID).style.overflow = 'hidden';
}
else{
$($sID).style.height = 'auto';
$($sID).style.overflow = 'auto';
}
}
Event.observe('ai_section', 'click', function(){ Section('ai_section', 'assessmentinstruments');} )
</script>
[/color]
</span>
<div class="sectiontitle"><a name="#Assessment Instruments">Assessment Instruments</a></div>
<div class="row">
<input type="CHECKBOX" name="assess_int0" value="Beck Depression Inventory" checked="CHECKED" class="radiocheck" id="assess_int0">
Beck Depression Inventory
<input type="CHECKBOX" name="assess_int1" value="Structured Clinical Interview" class="radiocheck" id="assess_int1">
Structured Clinical Interview
<input type="CHECKBOX" name="assess_int2" value="Hamilton Psychiatric Rating" checked="CHECKED" class="radiocheck" id="assess_int2">
Hamilton Psychiatric Rating
<input type="CHECKBOX" name="assess_int3" value="Scale for Depression" checked="CHECKED" class="radiocheck" id="assess_int3">
Scale for Depression
<input type="CHECKBOX" name="assess_int4" value="Patient Health Questionnaire" checked="CHECKED" class="radiocheck" id="assess_int4">
Patient Health Questionnaire
<input type="CHECKBOX" name="assess_int5" value="Pain Intensity Scale" checked="CHECKED" class="radiocheck" id="assess_int5">
Pain Intensity Scale
<input type="CHECKBOX" name="assess_int6" value="Global Assessment of Functioning" checked="CHECKED" class="radiocheck" id="assess_int6">
Global Assessment of Functioning
<input type="CHECKBOX" name="assess_int7" value="Million Visual Analog Scale" checked="CHECKED" class="radiocheck" id="assess_int7">
Million Visual Analog Scale
<input type="CHECKBOX" name="assess_int8" value="Psychosocial Stressors Scale" checked="CHECKED" class="radiocheck" id="assess_int8">
Psychosocial Stressors Scale<br />
<input type="CHECKBOX" name="assess_int9" value=":" class="radiocheck" style="" id="assess_int9_chk">
:
<input type="TEXT" name="assess_int9_s0" class="long" style="" id="assess_int9_s0" value="">
<script language="JAVASCRIPT" type="TEXT/JAVASCRIPT">
Event.observe('assess_int9_chk', 'click', function() { ClearTextIfNotChecked('assess_int9_chk', 'assess_int9_s0'); });
</script>
<script language="JAVASCRIPT" type="TEXT/JAVASCRIPT">
Event.observe('assess_int9_s0', 'keypress', function() { CheckIfTextChanged('assess_int9_s0', 'assess_int9_chk'); });
</script>
<input type="CHECKBOX" name="assess_int10" value=":" class="radiocheck" style="" id="assess_int10_chk">
:
<input type="TEXT" name="assess_int10_s0" class="long" style="" id="assess_int10_s0" value="">
<script language="JAVASCRIPT" type="TEXT/JAVASCRIPT">
Event.observe('assess_int10_chk', 'click', function() { ClearTextIfNotChecked('assess_int10_chk', 'assess_int10_s0'); });
</script>
<script language="JAVASCRIPT" type="TEXT/JAVASCRIPT">
Event.observe('assess_int10_s0', 'keypress', function() { CheckIfTextChanged('assess_int10_s0', 'assess_int10_chk'); });
</script>
<input type="CHECKBOX" name="assess_int11" value=":" class="radiocheck" style="" id="assess_int11_chk">
:
<input type="TEXT" name="assess_int11_s0" class="long" style="" id="assess_int11_s0" value="">
<script language="JAVASCRIPT" type="TEXT/JAVASCRIPT">
Event.observe('assess_int11_chk', 'click', function() { ClearTextIfNotChecked('assess_int11_chk', 'assess_int11_s0'); });
</script>
<script language="JAVASCRIPT" type="TEXT/JAVASCRIPT">
Event.observe('assess_int11_s0', 'keypress', function() { CheckIfTextChanged('assess_int11_s0', 'assess_int11_chk'); });
</script>
</div>
<div class="line"></div>
</div>
<script language="JAVASCRIPT" type="TEXT/JAVASCRIPT">oLoading.document.all.percent.innerHTML = "Chief Complaint";</script>
The problem code is in red. When the box is checked, the section should expand and when it's unchecked the section should contract. It contracts fine, but when it expands, everything in the section disappears. Help!
Keith Davis
MCSA, A+, N+, Guru+, Geek+, Child of God++++++
Love and Service