[Javascript] Showing and Hiding Divs

Glenn E. Lanier, II glenn_lanier at netzero.net
Fri Jul 8 10:34:08 CDT 2005


> From: Flavio Gomes
> Sent: Friday, July 08, 2005 9:43 AM

> I made a change to your css that seemed to solve it: I just added 
> "display: none" to all three div's to start with and commented the
> "ShowLayer('divCreditFACTSContainer', false);" Line.

Thanks. That does seem to solve the problem. I guess I've just read so many
times that you should not display:none initially; allow JavaScript to hide the
object, for accessibility. However, in this case, we determined JavaScript was
enabled before login is allowed (many pages back!).

> Ps.: On reloading by (CTRL+R) the radio will still be 
> selected, but the 
> div won't show.. T_T

Right, so I have this function:

function SelectRadio(theRadio, theValue)
{
	for (var i = 0; i < theRadio.length; i++) 
	{       
		if  (theValue == theRadio[i].value)
		{
			theRadio[i].checked = "1";
			break;
		}
	}
}

that I call from the page

SelectRadio(document.SubForm.PayOpt, "G");

Is there a more elegant way of doing this?

Thanks,
Glenn

> > The CSS (inline), the HTML, and the JavaScript (also inline) are at 
> > http://bellsouthpwp.net/S/p/Speedy7/fees.html.
> >  
> > Any help, pointers, tips, etc. is appreciated.

glenn_lanier at netzero dot net




More information about the Javascript mailing list