Help - Search - Members - Calendar
Full Version: Hidden DIV being displayed
HTMLHelp Forums > Web Authoring > Cascading Style Sheets
bruce779
Hi guys.
Thanks for looking.

I have a DIV on my form that should be hidden until a particular set of conditions are met.
The problem is the div is always being displayed.
Here is the code i'm using:
CODE
<div id="showProvidedProofs_#DisProofLoop#" style="display: none;"></div>


The div contents are nothing special, just some <td></td>s
There is a javascript function which should activate the div.

java script:
CODE
function showProofBlock(loop)
    {
        for (x=1; x<=flagArray.length-1; x++)
        {
            if(flagArray[x][1] == document.getElementById('disabilityProofType_'+loop).value)
            {
                if(flagArray[x][2] == 'Y' && flagArray[x][4] == 'Y')
                {
                    document.getElementById('showProvidedProofs_'+loop).style.display = 'block';
                    document.getElementById('providedProof_'+loop).value = document.getElementById('disabilityProofType_'+loop).value;/*set table element to the value of the select list element*/
                }
                else
                {
                    document.getElementById('providedProof_'+loop).value = '';/*table element within the div*/
                }        
            }        
        }    
    }


The Javascript function is called via an onChange="" with a select tag.

This is really confusing me as there is another hidden div on my form which is activated via javascript on the javascript is called from an onChange="" and this other hidden div works fine.

I would really appreciate any help you guys can provide.
My hair is being removed by the handful and i'm too young and pretty to be bald! biggrin.gif
Darin McGrew
QUOTE
The div contents are nothing special, just some <td></td>s
It's hard to say anything without the URL of a sample document, but this quote makes it sound like your structure is pretty badly broken. You can't put td elements inside div elements directly. You can put table elements inside div elements, and you can put div elements inside td elements.
bruce779
QUOTE(Darin McGrew @ Feb 19 2008, 09:30 AM) *

QUOTE
The div contents are nothing special, just some <td></td>s
It's hard to say anything without the URL of a sample document, but this quote makes it sound like your structure is pretty badly broken. You can't put td elements inside div elements directly. You can put table elements inside div elements, and you can put div elements inside td elements.


Thanks for that.
I wasn't aware of that blush.gif

I have fixed the problem by doing away with the div and putting style="display: none;"
into each of the three td elements.
Everything seems ok now.
Unfortunately, I can't supply the URL as my employers are pretty strict about access to the site.

Thanks for your help.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.