[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

07/10/2008 at 01:02PM PDT, ID: 23555247
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.1

Show/Hide multiple layers based on value from radio group

Asked by adamlund in JavaScript

Tags: Javascript

Hi 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
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
<html>
<head>
<style type="text/css">
div {width:300px; height:50px; background-color:#99FF66; visibility:hidden;}
</style>
<script language="javascript">
function showhide() {
 
for (var i=0; i < 6; i++)
   {
   if (document.form1.reference_type[i].checked)
      {
      var ref_val = document.form1.reference_type[i].value;
      }
   }
 
for (var j = 1; j <7; j++)
	{
	var division = 'div'+j;
	if (j == ref_val)
	{
	document.getElementById('division').style.visibility = 'visible';
	document.getElementById('division').style.height = 'auto';
	}
	else 
	{
	document.getElementById('division').style.visibility = 'hidden';
	document.getElementById('division').style.height = 0;
	}
	}
}
</script>
</head>
 
<body>
<form name="form1" method="post" action="">
  <p>
    <label>
    <input type="radio" name="reference_type" value="1" onClick="showhide();"> 
    Div1</label>
    <br>
    <label>
    <input type="radio" name="reference_type" value="2" onClick="showhide();">
    Div2<br>
    <input type="radio" name="reference_type" value="3" onClick="showhide();"> 
    Div3
</label>
    <br>
    <label>
    <input type="radio" name="reference_type" value="4" onClick="showhide();"> 
    Div4
<br>
<input type="radio" name="reference_type" value="5" onClick="showhide();"> 
Div5
</label>
    <br>
    <label>
    <input type="radio" name="reference_type" value="6" onClick="showhide();"> 
    Div6
</label>
    <br>
  </p>
</form>
<div id="div1" style="visibility:visible; ">div1</div>
<div id="div2">div2</div>
<div id="div3">div3</div>
<div id="div4">div4</div>
<div id="div5">div5</div>
<div id="div6">div6</div>
</body>
</html>
[+][-]07/10/08 01:17 PM, ID: 21976975

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/10/08 01:21 PM, ID: 21977013

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/10/08 01:30 PM, ID: 21977097

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: JavaScript
Tags: Javascript
Sign Up Now!
Solution Provided By: GoofyDawg
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07/10/08 01:31 PM, ID: 21977101

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/10/08 01:50 PM, ID: 21977277

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/10/08 02:14 PM, ID: 21977455

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/10/08 02:52 PM, ID: 21977703

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/10/08 03:41 PM, ID: 21977999

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74 / EE_QW_2_20070628