The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Hidden DIV being displayed
bruce779
post Feb 19 2008, 04:00 AM
Post #1





Group: Members
Posts: 2
Joined: 19-February 08
Member No.: 4,998



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Feb 19 2008, 04:30 AM
Post #2


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
bruce779
post Feb 19 2008, 05:24 AM
Post #3





Group: Members
Posts: 2
Joined: 19-February 08
Member No.: 4,998



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th April 2024 - 09:38 PM