[Javascript] Showing and Hiding Divs

Glenn E. Lanier, II glenn_lanier at netzero.net
Thu Jul 7 13:58:34 CDT 2005


Thanks to help from this list, I have a function that will show or not show a
div. All seemed to work properly, but I'm running into some problems using IE.
 
I have two radio buttons (in the example); if the first one is selected, I show
credit card payment options (by displaying divCreditCard). If the second is
selected, I show another payment option called FACTS (likewise, displaying
divFACTSInfo). Both divCreditCard and divFACTSInfo are members of
divCreditFACTSContainer.
 
When the page loads, I hide divCreditFACTSContainer.
 
When the radio button is selected, I hide divCreditFACTSContainer,
divCreditCard, and divFACTSInfo (in real life, some payment method selection
will require that no payment options are displayed). I then determine which
option was selected, showing divCreditFACTSContainer and the appropriate other
div.
 
The problem, in IE6, is that the border assigned to both divCreditCard and
divFACTSInfo show, regardless of which div is displayed, but only on the first
time the option is selected (per page load). 
 
Example: when the page is loaded, divCreditFACTSContainer is hidden. Select
"Credit Card", see alert messages (for debugging) that show all three layers
being hidden. See message showing divCreditFACTSContainer (see border appear),
see message showing divCreditCard (see border appear), see message hiding
divFACTSInfo (see border appear -- I originally didn't have this hide in place,
but added it in testing). Now, select "FACTS", see similar, except divCreditCard
border disappears. Now, select "Credit card" and see only
divCreditFACTSContainer and divCreditCard. If you reload the page, and select
"FACTS" first, you'll see the divCreditCard border.
 
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.
 
--G
 
  _____  

Glenn E. Lanier II

* Email:  <mailto:glenn_lanier at netzero.net> glenn_lanier at netzero.net
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20050707/ddaec956/attachment.htm>


More information about the Javascript mailing list