|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
||||
|
||||
|
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. |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
||||
|
||||
|
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>
|
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > Hidden Link |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|