473,386 Members | 1,644 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Display only certain information in a page

107 100+
i have a page where i have name of my company staffs and is hyperlinked to another page where all the details of the staffs are present. I mean a page contains only the staffs name and in the other page, the details about all the staffs in order. Now when i click a staff name in the first page i want only the details of the particular staff to display in the second page. I dont want the whole lot of details about all staffs to display. How can i achieve this? My page is static in nature.
Apr 21 '09 #1
8 2086
Dormilich
8,658 Expert Mod 8TB
2 possibilities:
- purely static: make a page for each user
- dynamic: pass a parameter, which is used to identify the user and load only the details of that user (you may use Javascript if no server side script is possible, but it's not the best choice)
Apr 21 '09 #2
raamay
107 100+
@Dormilich
Yea i was expecting the javascript option. I have seen such achievable with javascript in action but i forgot where to find it. I dont find a particular key word to google it. Can you help me out?
Apr 21 '09 #3
acoder
16,027 Expert Mod 8TB
Look into the style.display property (set to "block" to display and "none" to hide).

PS. moved to the JavaScript forum.
Apr 21 '09 #4
raamay
107 100+
@acoder
I am sorry i didnt understand you. Its stylesheet i suppose that you are talking about.
Apr 22 '09 #5
Dormilich
8,658 Expert Mod 8TB
with element.style.* you have access to CSS properties of an element.
Apr 22 '09 #6
acoder
16,027 Expert Mod 8TB
For an explanation, see this or this. element.style.display is explained here.
Apr 22 '09 #7
gopan
41
I think this is the solution.... your employees.html have links to emp_details.html
Expand|Select|Wrap|Line Numbers
  1. <a href="emp_details.html#jsmith" rel="employee" target="_self">Mr. John Smith
  2. </a><br/>
  3. <a href="emp_details.html#sleon"  rel="employee" target="_self">Ms. Sandra Leon</a>
  4.  
and your emp_details.html looks like this

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Employee Detilas</title>
  6. <style>
  7. .hidden{
  8.     display:none;
  9.     visibility:hidden;
  10. }
  11. .shown{
  12.     display:block;
  13.     visibility:visible;
  14. }
  15. </style>
  16. <script language="javascript">
  17.     function showdetails(){
  18.         var hash = window.location.hash;
  19.         var emp;
  20.         if(hash){
  21.             emp = hash.substr(1);
  22.             document.getElementById(emp).className = "shown";
  23.         } else {
  24.             alert("Please choose an employee to see details.");
  25.         }
  26.     }
  27. </script>
  28. </head>
  29. <body>
  30. <div id="jsmith" class="hidden">
  31. <h1>John Smith</h1>
  32. Emp ID : 1155646<br />
  33. Des : Programmer<br />
  34. Cat : CD01
  35. </div>
  36. <div id="sleon" class="hidden">
  37. <h1>Sandra Leon</h1>
  38. Emp ID : 1155647<br />
  39. Des : Quality Controller<br />
  40. Cat : QA07
  41. </div>
  42. <script language="javascript">
  43.     showdetails();
  44. </script>
  45. </body>
  46. </html>
  47.  
Apr 22 '09 #8
raamay
107 100+
This is exactly what i wanted. Thankyou somuch.
Apr 23 '09 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: dmiller23462 | last post by:
I'm trying to create a submission page for users to request PC/LAN Access....If they select "Yes" in the field asking about if they need Non Standard Software, I want several other HTML fields to...
1
by: chris ogunsalu via .NET 247 | last post by:
(Type your message here) does anyone have some good example of How to read xml into a recordset and display in fields on page. for each node in the xml file i only want to display certain...
1
by: Blue Bell Trading - Customer Services | last post by:
Hi, If I have managed to pull a html page from the internet and stored it into a string, how do you think I should go about displaying only a certain part of the HTML? For example, I would only...
5
by: Peter Lapic | last post by:
I have to create a image web service that when it receives an imageid parameter it will return a gif image from a file that has been stored on the server. The client will be an asp.net web page...
2
by: Suman | last post by:
Happy Friday everyone!!! I am working on a windows service and a C# application and needed some help with certain functionality. Please read through my issue below. Thanks! I have a windows...
1
by: Benny Ng | last post by:
Dear All, Now I met one problem in the development of my one application. I have one ASP.NET page. It's for disply the information of customer. But now I have one new requirement. It's to...
14
by: lmttag | last post by:
Hello. We're developing an ASP.NET 2.0 (C#) application and we're trying to AJAX-enable it. We're having problem with a page not showing the page while a long-running process is executing. So,...
9
by: Edward | last post by:
IE6 only displays certain text on my site if you mouse over it (!). I reduced the HTML down to this code below which still shows this effect/bug. My temporary solution was to take out all the...
1
by: mramsay | last post by:
Hi there, I have a dynamic hyperlink Baseball. When the user select the hyperlink they are redirected to another page. After that I want to display information on the page from my linkstbl. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.