Advertisement

06.09.2008 at 05:28AM PDT, ID: 23468776
[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!

8.2

Javascript multiple drop down boxes show hide div checkboxes

Asked by maitteam in JavaScript, Pocket PC Other

Tags: ,

Hi there

Please can someone provide some javascript code that will allow me to show/hide a <div> section that contains checboxes based on the value of a drop down box. I have managed to find code that will let me do this but only for one drop down on a page, I need code to allow this for several drop down boxes on a page.

I have provided the code I have so far. What I' m trying to do is when the user selects 'No' from the drop down box the <div> section for that drop down box appears only and if the user selects anything else the <div> section is hidden.

Can someone help?

Also, just to make it that little bit harder the Javascript code must be Javascript 1.1 compatible as the page will be viewed in Pocket Internet Explorer on Windows Mobile 5.

Regards!Start Free Trial
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:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
<html>
<head>
<meta http-equiv="Content-Language" content="en-gb">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
 
 
<SCRIPT>
function show(aval) {
if (aval == "0") {
optionyes.style.visibility='visible';
optionyes.style.display='block';
} 
if (aval == "1") {
optionyes.style.visibility='hidden';
optionyes.style.display='none';
}
if (aval == "-1") {
optionyes.style.visibility='hidden';
optionyes.style.display='none';
}
if (aval == "Select") {
optionyes.style.visibility='hidden';
optionyes.style.display='none';
}
if (aval == "0") {
optionyes2.style.visibility='hidden';
optionyes2.style.display='none';
}
}
</SCRIPT>
 
 
<title>Test Page 1</title>
</head>
 
<body>
 
<form method="POST" action="page3.asp" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1">
	<table border="0" width="228" style="border-collapse: collapse">
		<tr>
			<td width="160"><font size="2" face="Arial">Test Question 1</font>
				<div id="optionyes" style="display:none"><input type="checkbox" name="c1" value="ON"></font><font size="1" face="Arial">Option 1<br>
				</font><font face="Arial"><input type="checkbox" name="c2" value="ON"></font><font face="Arial" size="1">Option 2<br>
				</font><font face="Arial"><input type="checkbox" name="c3" value="ON"></font><font face="Arial" size="1">Option 3</p>
				</div>
			</font>
			</td>
			<td align="left" width="64" valign="top">
			<font face="Arial">
			<!--webbot bot="Validation" b-disallow-first-item="TRUE" --><select size="1" name="B01" onchange="java_script_:show(this.options[this.selectedIndex].value)">
	<option selected value="Select">Select</option>
	<option value="1">Yes</option>
	<option value="0">No</option>
	<option value="-1">N/A</option>
	</select></font></td>
		</tr>
		<tr>
			<td width="160"><font size="2" face="Arial">Test Question 2</font>
			<div id="optionyes2" style="display:none"><input type="checkbox" name="c4" value="ON"></font><font face="Arial" size="1">Option 1<br>
				</font><font face="Arial"><input type="checkbox" name="c5" value="ON"></font><font face="Arial" size="1">Option 2<br>
				</font><font face="Arial"><input type="checkbox" name="c6" value="ON"></font><font face="Arial" size="1">Option 3<br>
				</font><font face="Arial"><input type="checkbox" name="c7" value="ON"></font><font face="Arial" size="1">Option 4</p></div></td>
			<td align="left" width="64" valign="top">
			<font face="Arial">
			<!--webbot bot="Validation" b-disallow-first-item="TRUE" --><select size="1" name="B02" onchange="java_script_:show(this.options[this.selectedIndex].value)">
	<option selected value="Select">Select</option>
	<option value="1">Yes</option>
	<option value="0">No</option>
	<option value="-1">N/A</option>
	</select></font></td>
		</tr>
		<tr>
			<td width="160"><font size="2" face="Arial">Test Question 3</font>
			<div id="optionyes2" style="display:none"><input type="checkbox" name="c8" value="ON"></font><font face="Arial" size="1">Option 1<br>
				</font><font face="Arial"><input type="checkbox" name="c9" value="ON"></font><font face="Arial" size="1">Option 2</font></div></td>
			<td align="left" width="64" valign="top">
			<font face="Arial">
			<!--webbot bot="Validation" b-disallow-first-item="TRUE" --><select size="1" name="B05" onchange="java_script_:show(this.options[this.selectedIndex].value)">
	<option selected value="Select">Select</option>
	<option value="1">Yes</option>
	<option value="0">No</option>
	<option value="-1">N/A</option>
	</select></font></td>
		</tr>
		<tr>
			<td width="160">&nbsp;</td>
			<td align="left" width="64">
			<font face="Arial">
			&nbsp;</font></td>
		</tr>
		</table>
	<p><font face="Arial"><input type="submit" value="Next Page" name="B1"></font></p>
	<input type="hidden" name="A01" value="<% = Request("A01") %>">
	<input type="hidden" name="A02" value="<% = Request("A02") %>">
	<input type="hidden" name="A03" value="<% = Request("A03") %>">
</form>
 
</body>
 
</html>
 
Loading Advertisement...
 
[+][-]06.09.2008 at 05:34AM PDT, ID: 21742653

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.09.2008 at 05:46AM PDT, ID: 21742718

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.09.2008 at 05:48AM PDT, ID: 21742726

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.10.2008 at 07:20AM PDT, ID: 21751491

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 08:13AM PDT, ID: 21760877

View this solution now by starting your 7-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

Zones: JavaScript, Pocket PC Other
Tags: javascript, Pocket Internet Explorer
Sign Up Now!
Solution Provided By: maitteam
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628