ps: your label tags are not nested correctly, you need to place them correctly.
Main Topics
Browse All TopicsHi All,
I have a form where if you select a radiobox from a radio group it highlights a corresponding layer but hides all other layers. The values from the radio box are numbered 1 to 6. The divs are numbered div1 (corresponding to value=1 from radio group), div2, div3 etc. I can get the current value of the checked radio box but I am having problems looping through the divs allowing a show/hide facility.
Any help much appreciated.
Adam
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Fixed your HTML up a bit. With the new showhide(), I added a parameter that would be passed directly from the radio button. That way you don't have to interrogate the form element for its value. The function already has it. Then it's just a matter of doing some simple logic to show and hide the divs.
BTW, for something like this, using the "visibility" CSS attribute is not a good idea as the space that the divs take up does not go away when you set them to hidden. display:none and display:"" is much better.
Anyway, code is below:
Hi cem_turk,
Many thanks for your code but I have to give GoofyDawg the points as for some reason it would not work properly in Firefox 3 (which I think is where I was having my problems). It works in Opera and IE7. For some reason if you clicked on radio box 3 (Div3) or 5 (Div 5) it would automatically check Div 2 and Div 4, respectively, instead. Just thought I would mention it as it seems a really wierd problem.
Adam
Business Accounts
Answer for Membership
by: cem_turkPosted on 2008-07-10 at 13:17:10ID: 21976975
Select allOpen in new window