J
JNariss
Hello,
I have created an Intranet for my company and was trying to figure out
if I can add a password to a button on my webpage. Well........I know I
can the question now is how???
I want to add the password to this code (the code for my button):
<p>
<a href="Overnight%20Parking.doc">
<img border="0" id="img20" src="../Buttons/button353.jpg" height="33"
width="165" alt="Overnight Parking"
onmouseover="FP_swapImg(1,0,/*id*/'img20',/*url*/'../Buttons/button354.jpg')"
onmouseout="FP_swapImg(0,0,/*id*/'img20',/*url*/'../Buttons/button353.jpg')"
onmousedown="FP_swapImg(1,0,/*id*/'img20',/*url*/'../Buttons/button355.jpg')"
onmouseup="FP_swapImg(0,0,/*id*/'img20',/*url*/'../Buttons/button354.jpg')"
fp-style="fp-btn: Glass Rectangle 3" fp-title="Overnight
Parking"></a></p></div>
<p>
I figure it will have to be somehow implemented into the onmousedown,
however I am unsure of how to do this.
I have a simple password code that works when added to the beginning of
my html code for when a page is opened, which is:
<SCRIPT language="JavaScript">
<!--hide
var password;
var pass1="cool";
password=prompt('Please enter your password to view this page!',' ');
if (password==pass1)
alert('Password Correct! Click OK to enter!');
else
{
window.location="http://www.pageresource.com/jscript/jpass.htm";
}
//-->
</SCRIPT>
I also found this code within the search groups:
<!-- Begin
function click() {
if (event.button==2) {
alert('Sorry, on the login page you cannot right-click. This is for
security reasons.');
}
}
document.onmousedown=click
function Login(){
var done=0;
var username=document.login.username.value;
username=username.toLowerCase();
var password=document.login.password.value;
password=password.toLowerCase();
if (username=="user1" && password=="pass1") {
window.location="logged.htm"; done=1; }
if (username=="user2" && password=="pass2") {
window.location="logged.html"; done=1; }
if (username=="user3" && password=="pass3") {
window.location="logged.html"; done=1; }
if (username=="user4" && password=="pass4") {
window.location="logged.html"; done=1; }
if (done==0) { alert(" Login failure. Try again. "); }
//The following are the greetings for each user
if (username=="user1" && password=="pass1") { alert(" Hello User1!
"); }
if (username=="user2" && password=="pass2") { alert(" Hello user2!
"); }
if (username=="user3" && password=="pass3") { alert(" Hello user3!
"); }
if (username=="user4" && password=="pass4") { alert(" Hello user4!
"); }
}
// End -->
But I have no idea where to enter the code into the current html code.
If anyone could help me with this I would greatly appreciate it. Unless
someone has a better idea that will work too.
Thanks,
Justine
I have created an Intranet for my company and was trying to figure out
if I can add a password to a button on my webpage. Well........I know I
can the question now is how???
I want to add the password to this code (the code for my button):
<p>
<a href="Overnight%20Parking.doc">
<img border="0" id="img20" src="../Buttons/button353.jpg" height="33"
width="165" alt="Overnight Parking"
onmouseover="FP_swapImg(1,0,/*id*/'img20',/*url*/'../Buttons/button354.jpg')"
onmouseout="FP_swapImg(0,0,/*id*/'img20',/*url*/'../Buttons/button353.jpg')"
onmousedown="FP_swapImg(1,0,/*id*/'img20',/*url*/'../Buttons/button355.jpg')"
onmouseup="FP_swapImg(0,0,/*id*/'img20',/*url*/'../Buttons/button354.jpg')"
fp-style="fp-btn: Glass Rectangle 3" fp-title="Overnight
Parking"></a></p></div>
<p>
I figure it will have to be somehow implemented into the onmousedown,
however I am unsure of how to do this.
I have a simple password code that works when added to the beginning of
my html code for when a page is opened, which is:
<SCRIPT language="JavaScript">
<!--hide
var password;
var pass1="cool";
password=prompt('Please enter your password to view this page!',' ');
if (password==pass1)
alert('Password Correct! Click OK to enter!');
else
{
window.location="http://www.pageresource.com/jscript/jpass.htm";
}
//-->
</SCRIPT>
I also found this code within the search groups:
<!-- Begin
function click() {
if (event.button==2) {
alert('Sorry, on the login page you cannot right-click. This is for
security reasons.');
}
}
document.onmousedown=click
function Login(){
var done=0;
var username=document.login.username.value;
username=username.toLowerCase();
var password=document.login.password.value;
password=password.toLowerCase();
if (username=="user1" && password=="pass1") {
window.location="logged.htm"; done=1; }
if (username=="user2" && password=="pass2") {
window.location="logged.html"; done=1; }
if (username=="user3" && password=="pass3") {
window.location="logged.html"; done=1; }
if (username=="user4" && password=="pass4") {
window.location="logged.html"; done=1; }
if (done==0) { alert(" Login failure. Try again. "); }
//The following are the greetings for each user
if (username=="user1" && password=="pass1") { alert(" Hello User1!
"); }
if (username=="user2" && password=="pass2") { alert(" Hello user2!
"); }
if (username=="user3" && password=="pass3") { alert(" Hello user3!
"); }
if (username=="user4" && password=="pass4") { alert(" Hello user4!
"); }
}
// End -->
But I have no idea where to enter the code into the current html code.
If anyone could help me with this I would greatly appreciate it. Unless
someone has a better idea that will work too.
Thanks,
Justine