HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 20th, 2004, 06:50 PM
Matt71 Matt71 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 21 Matt71 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Hidden Link

I am trying to add a hidden hyperlink to a .htm page so that staff members can go to a restricted page to update user account details. I have added a link and changed code in a css file to hide the link.

Problem I have is that when I first load the page the link is visible, but then once I click on it and go back to this page, or even reload it, it's not visible. It's quite odd really.

Does anyone know of a way to have a link hidden, and preferably to stop the mouse pointer from turning in to a hand when moving over it?

My code for the CSS file and the hyperlink is:



a class="restrict" href = "restricted.asp">Staff</a - I have got the closing tags, but when I put it on this forum page it turns it in to a link so I have left them out.

Reply With Quote
  #2  
Old May 20th, 2004, 07:39 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,760 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 5 h 18 m 17 sec
Reputation Power: 443
here is how I do mine. when I type the correct word (ABCDEFG for this example), a link displays for me to access the administrative section of my site.
Code:
function keyDownHandler() {
   keyPressed = window.event.keyCode;
   if (keyPressed == 65 & checkValue == 0) { checkValue = 1; }
   if (keyPressed == 66 & checkValue == 1) { checkValue = 2; }
   if (keyPressed == 67 & checkValue == 2) { checkValue = 3; }
   if (keyPressed == 68 & checkValue == 3) { checkValue = 4; }
   if (keyPressed == 69 & checkValue == 4) { checkValue = 5; }
   if (keyPressed == 70 & checkValue == 5) { checkValue = 6; }
   if (keyPressed == 71 & checkValue == 6) { window.parent.navigation.adminSettingsSpan.innerHT  ML = '<a href="restricted.asp" class="restrict" target="main">STAFF</a>'; }
   if (keyPressed < 65 | keyPressed > 71) { checkValue = 0; }
}

In the <body>, just call the KeyDownHandler Function
Code:
<body onKeyDown="keyDownHandler();">

Last edited by Memnoch : May 20th, 2004 at 07:44 PM.

Reply With Quote
  #3  
Old May 20th, 2004, 07:58 PM
Matt71 Matt71 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 21 Matt71 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Can't get it to work

I have figured out how to change the word that is required, but nothing seems to happen. Is it supposed to open the window after typing it, or just make the text visible.

I think it's running the script correctly as when I finish typing the required text, I then get an error message:

'window.parent.navigation.adminSettingsSpan.innerH TML' is null or not an object. How do I fix this problem?

Last edited by Matt71 : May 20th, 2004 at 08:55 PM. Reason: Further Error Message

Reply With Quote
  #4  
Old May 20th, 2004, 10:20 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,760 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 5 h 18 m 17 sec
Reputation Power: 443
Sorry, my mistake. The code I posted above a) runs in a frame and b) wasn't complete.

This will work for you.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">

checkValue = 0;

function keyDownHandler() {
   keyPressed = window.event.keyCode;
   if (keyPressed == 65 & checkValue == 0) { checkValue = 1; }
   if (keyPressed == 66 & checkValue == 1) { checkValue = 2; }
   if (keyPressed == 67 & checkValue == 2) { checkValue = 3; }
   if (keyPressed == 68 & checkValue == 3) { checkValue = 4; }
   if (keyPressed == 69 & checkValue == 4) { checkValue = 5; }
   if (keyPressed == 70 & checkValue == 5) { checkValue = 6; }
   if (keyPressed == 71 & checkValue == 6) { adminSettingsSpan.innerHTML = '<a href="restricted.asp" class="restrict" target="main">STAFF</a>'; }
   if (keyPressed < 65 | keyPressed > 71) { checkValue = 0; }
}

</script>
</head>

<body onKeyDown="keyDownHandler();">
<table border="0" cellspacing="0" cellpadding="8">
   <tr> 
      <td><span ID="adminSettingsSpan"><a href="#" class="navigation" target="main"></a></span></td>
   </tr>
</table>
</body>
</html>

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > Hidden Link


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway