Solved

Simple Show/Hide issue

Posted on 2011-09-22
3
261 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 500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

734 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