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*/
}
}
}
}
{
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!