Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide/Show information

Status
Not open for further replies.

DKL01

Programmer
Sep 14, 2000
233
US
Hi

We an an ASP page which displays Department information. We he around 10 departments. All users are not interested in all information. High level users will look at 1 or 2 departments only.

I have seen some web applications where we can Hide/Show the information. I works like this :

+ Deparment 1
+ Deparment 2
+ Deparment 3

Once we click on + sign next to Deparment 1 the screen will appear like this

Deparment 1

ABC 1000 02/02/2002
EFG 2000 02/02/2002
RFG 4000 03/02/2002
/
+ Deparment 2
+ Deparment 3

If we click on /\ it hides the Dept 1 info.

I was wondering how to implement this. I really appreciate any ideas.

Thanks
 
The best way to do this is to use JavaScript and then use the onClick event to show and hide it. A rough stab at the code would be:

<A NAME=&quot;Dept1&quot; onClick=&quot;dept1Details.style.display='inline'&quot;>Department 1</A>
<DIV ID=&quot;dept1Details&quot; style=&quot;display: none;&quot;>
ABC 1000 02/02/2002<BR>
EFG 2000 02/02/2002<BR>
RFG 4000 03/02/2002<BR>
<A onClick=&quot;dept1Details.style.display='none'&quot;>/\</A>
</DIV>

Hope that helps a little. The code is not very pretty but it should give you an idea. Mighty :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top