No, document.getElementById(myObj).style.visible/visibility doesn't work.
Here's the situation.
I have 3 areas on my page controlled by a <select...> so if the first <option> is selected, show area 1, and so forth.
I need to validate what fields are currently visible and act upon them, but I don't want those that are not visible to have any effect on my processing.
the body onload event sets the span's style.display = 'none';
My other javascript checks for a custom tag (reqd) added to the required controls and when I click a button, I want it to return the number of required fields.
I have tried oObj.style.visibility which returns empty always because the style is never set, only the container span is set as displayed or not.
Help? -----------------------------------
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rich Cook
Here's the situation.
I have 3 areas on my page controlled by a <select...> so if the first <option> is selected, show area 1, and so forth.
I need to validate what fields are currently visible and act upon them, but I don't want those that are not visible to have any effect on my processing.
the body onload event sets the span's style.display = 'none';
My other javascript checks for a custom tag (reqd) added to the required controls and when I click a button, I want it to return the number of required fields.
Code:
function cntVis()
{
var iCnt = 0;
for( index=0; index< document.all.length; index++)
{
oObj = document.all(index);
if( oObj.getAttribute('reqd') )
{
//check if element is visible
//do something
iCnt ++;
}
}
alert( iCnt);
}
Help? -----------------------------------
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rich Cook