[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.

Question
[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.4

checkbox turn off one div, but turn on another...

Asked by whaleyk in JavaScript

Tags: javascript

I thought it would be easy to find an example of this, but I can't seem to.

I can show and hide the details div no problem based on user checking and unchecking.  However, if they uncheck, i want to display div id="detailsNone" and I can't seem to figure it out.  

Also, you'll notice that I have two divs called "details", i need to control the display of both of these (and I know they shouldn't be named the same. )

Thanks as always.
K
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:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript">
function toggle(divId) {
	var divArray = document.getElementsByTagName("div");
	for(i = 0; i < divArray.length; i++){
		if(divArray[i].id == divId){
			if(divArray[i].style.display != 'none'){
				divArray[i].style.display = 'none';
			}else{
				divArray[i].style.display = '';
			}
		}
	}
}
</script>
</head>
<body>
<!--<body> -->
<table cellpadding="10">
  <tr>
    <td><font class="subHeading">Marketing Material Customization</font><br />
      <br />
      <form action="?" method="post" name="myform" id="myform">
        <table border="0" cellpadding="5">
          <tr valign="top">
            <td bgcolor="E2D0B3" width="220">Preview Custom Details:
              <div id="detailsNone">IF USER HAS UNCHECKED includeDetails CHECKBOX, SHOW ME... "You have selected not to add any ....."</div>
              <div id="details"> <font style="font-size:16px; font-weight:bold; line-height:18px;">xxxxxxxxxxxxxxxx <br />
                xxxxxxxxxxxxxx</font> <em>xxxxxxxxxxxxxxx </em> xxxxxxxxxxxxxxxxxxx <br />
                xxxxxxxxxxx <br />
                xxxxxxxxxxxxxxxx <br />
                xxxxxxxxxxxxxxxxxxxxxxx <br />
                xxxxxxxxxxxxxxxxxxxxxxxxxx
                <div id="p_altPhone" style="font-size: 16px; vertical-align: middle; display: block;   overflow: hidden;"></div>
                <div id="email1" style="display:inline"> xxxxxxxxxxxxxxxx </div>
                <div id="email2"  style="display:none"> xxxxxxxxxxxxxxxxxx </div>
              </div></td>
            <td style="line-height:16px;"><!--<input name="includePhoto" type="radio" value="No">
              No<br /> -->
              <p><strong>Would you like to include your photo and personal details?</strong><br />
                <input name="includeDetails" type="checkbox" value="Yes"  checked="checked" onClick="toggle('details');" />
                Yes</p>
              <div id="details"> name, etc. </div>
              <p><strong>Printing Preferences:</strong><br />
                <input type="radio" name="printingPref" value="11x17" />
                11 x 17 - <a href="#">Full 4 page Newsletter</a><br />
                <input type="radio" name="printingPref" value="8x11_full" />
                8 x 11 - <a href="#">Full 4 page Newsletter</a><br />
                <input type="radio" name="printingPref" value="8x11_cond" />
                8 x 11 - <a href="#">2 Page Only</a> </p>
              <!-- Name/Logos -->
              <!-- <input type="hidden" name="uselogo" id="uselogo" value="none"> -->
              <input type="hidden" name="htext" id="htext" value="NoT Provided" />
              <input name="" type="submit" value="Print" />
            </td>
          </tr>
        </table>
      </form></td>
  </tr>
</table>
</body>
</html>
 
Related Solutions
Keywords: checkbox turn off one div, but turn on…
 
Loading Advertisement...
 
[+][-]05/15/08 02:38 PM, ID: 21578201Expert Comment

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.

 
[+][-]05/15/08 02:39 PM, ID: 21578209Expert Comment

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.

 
[+][-]05/16/08 05:44 AM, ID: 21582159Author Comment

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.

 
[+][-]05/16/08 05:49 AM, ID: 21582194Accepted Solution

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: Badotz
Participating Experts: 1
Solution Grade: A
 
[+][-]05/16/08 05:52 AM, ID: 21582217Expert Comment

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.

 
[+][-]05/16/08 05:53 AM, ID: 21582225Expert Comment

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.

 
[+][-]05/16/08 06:00 AM, ID: 21582269Author Comment

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.

 
[+][-]05/16/08 06:21 AM, ID: 21582415Expert Comment

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...
20091111-EE-VQP-89 / EE_QW_2_20070628