Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text disappears???

Status
Not open for further replies.

laurin1

MIS
Apr 28, 2003
77
US
Here is the code:

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
 
Too many layers of coding for me.

I checked the base construct and it works ... if you put data in the contracted div and if the div is given a background color it becomes obvious that no issue exists at the basic level.

So either the data you put in the DIV is wierd (I got rid of that positiion absolute span whatever that was)... or characters are not substituted the way yuou expect.

Try this raw code on client side as is ... it works:

Code:
<div class="bluebox" id="assessmentinstruments" style="width=100;background-color:yellow; position:relative; height: 50px; overflow: hidden">

      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<p>
      yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy<p>
      zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz<p>
      [URL unfurl="true"]wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww<p>[/URL]

</div>
        <input type="CHECKBOX" name="ai_section" value="*" class="radiocheck" id="ai_section"
             onclick='Section(ai_section, assessmentinstruments);'>
        *

        <script>
            function Section($sCheck, $sID){

             alert($sID);
                
                if ($sCheck.checked == false){


                    
                    $sID.style.height = '50px';
                    $sID.style.overflow = 'hidden';


                    
                }
                
                else{


                
                    $sID.style.height = 'auto';
                    $sID.style.overflow = 'auto';


                }
            }

        </script>





</html>
 
Yea, this project is gotten so big, there's lots of weird stuff. :) The absolute span was to make the checkbox stay up in the corner inside the box. I'm sure it does work, but I need it to work with the data that's in the box, or I have to find a different solution. Your input was helpful, thanks.

Keith Davis
MCSA, A+, N+, Guru+, Geek+, Child of God++++++
Love and Service
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top