Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Simple Show/Hide issue

Posted on 2011-09-22
3
Medium Priority
?
264 Views
Last Modified: 2012-05-12
I've got the script below written and functioning expect for this issue:

Choose the last bullet.  Line 5 appears as it should.
Now choose any other bulleted line. Unfortunatly that also appears with Line 5.

Goal is to get all the Lines to appear one by one. This seems to only be happening with the Line 5 item.
 
I had this problem once before and I know it's simple but just cant recall what I did for it.
Any assitance is much appreciated.

Thank You
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<script>


function hideall(){
  for (count=1; count<5; count+=1) // set "count" to one more than the total images/links
  document.getElementById('box'+count).style.display='none'; 
    }


function showbox(box){
  document.getElementById(box).style.display='block';




}

  </script>
</head>

<body>
	<ul>
					<li><a href="#" onclick="hideall();showbox('box1')">
					<font face="Arial">
					<font size="2">What transactions are affected?<br></li>
					
					<li><a href="#" onclick="hideall();showbox('box2')">
					<font face="Arial">
					<font size="2">How do I register my NPI?<br></li>
					
					<li><a href="#" onclick="hideall();showbox('box3')">
					<font face="Arial">
					<font size="2">How do I verify if my NPI is registered with Aetna?<br></li>
					
					<li><a href="#" onclick="hideall();showbox('box4')">
					<font face="Arial">
					<font size="2">Does the NPI replace the Tax ID number?<br></li>
					
					<li><a href="#" onclick="hideall();showbox('box5')">
					<font face="Arial">
					<font size="2">Are providers allowed to send other identification numbers, such as PIN, PVN, and TIN, in electronic transactions?</li>
					</ul>
						</td>
					</tr>
				</table>

				</td>
				<td bgcolor="#FFFFFF">
<p style="margin-top: -2px" align="center"><font size="5" face="Arial">Answers Here</font></p>
<hr color="#003366">
<p>
<div id="Content1" style="width: 623px; height: 433px">
<div id="box1" style="display: none"><font face="Arial" size="2"><b>Line1</b></font></div>
<div id="box2" style="display: none"><font face="Arial" size="2"><b>Line2</b></font></div>
<div id="box3" style="display: none"><font face="Arial" size="2"><b>Line3</b></font></div>
<div id="box4" style="display: none"><font face="Arial" size="2"><b>Line4</b></font></div>
<div id="box5" style="display: none"><font face="Arial" size="2"><b>Line 5</b></font></div>
</body>

</html>

Open in new window

0
Comment
Question by:jscripter1138
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 63

Accepted Solution

by:
Zvonko earned 2000 total points
ID: 36581396
You missed:
  count<=5;
0
 

Author Closing Comment

by:jscripter1138
ID: 36581451
Another set of eyes always helps.... Thank you
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 36581606
And I do that show/hide thing like this:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Zvonko &#42;</title>
<script>
var divShow;
function showbox(box){
  if(divShow) divShow.style.display='none';
  divShow = document.getElementById(box);
  divShow.style.display='block';
}
</script>
</head>
<body>
	<ul>
					<li><a href="#" onclick="showbox('box1')">
					<font face="Arial">
					<font size="2">What transactions are affected?<br></li>
					
					<li><a href="#" onclick="showbox('box2')">
					<font face="Arial">
					<font size="2">How do I register my NPI?<br></li>
					
					<li><a href="#" onclick="showbox('box3')">
					<font face="Arial">
					<font size="2">How do I verify if my NPI is registered with Aetna?<br></li>
					
					<li><a href="#" onclick="showbox('box4')">
					<font face="Arial">
					<font size="2">Does the NPI replace the Tax ID number?<br></li>
					
					<li><a href="#" onclick="showbox('box5')">
					<font face="Arial">
					<font size="2">Are providers allowed to send other identification numbers, such as PIN, PVN, and TIN, in electronic transactions?</li>
					</ul>
						</td>
					</tr>
				</table>
				</td>
				<td bgcolor="#FFFFFF">
<p style="margin-top: -2px" align="center"><font size="5" face="Arial">Answers Here</font></p>
<hr color="#003366">
<p>
<div id="Content1" style="width: 623px; height: 433px">
<div id="box1" style="display: none"><font face="Arial" size="2"><b>Line1</b></font></div>
<div id="box2" style="display: none"><font face="Arial" size="2"><b>Line2</b></font></div>
<div id="box3" style="display: none"><font face="Arial" size="2"><b>Line3</b></font></div>
<div id="box4" style="display: none"><font face="Arial" size="2"><b>Line4</b></font></div>
<div id="box5" style="display: none"><font face="Arial" size="2"><b>Line 5</b></font></div>
</body>
</html>

Open in new window

0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question