Help - Search - Members - Calendar
Full Version: My password script no longer works.
HTMLHelp Forums > Programming > Client-side Scripting
ReBoot
The web page I'm working with uses <input type="button" value="View volunteer news" onClick="passWord()"> to prompt for a password and if it's correct go to a specific web page. It has worked for years, but now does not prompt for the password anymore.
I'm a novice at this.
Here is the code...
<script>
function passWord() {
var testV = 1;
var pass1 = prompt('Please Enter Your Password',' ');
while (testV < 3) {
if (!pass1)
history.go(-1);
if (pass1.toLowerCase() == "laura") {
//alert('You Got it Right!');
window.open('volunteer_news_a.html');
break;
}
testV+=1;
var pass1 =
prompt('Access Denied - Password Incorrect, Please Try Again.','Password');
}
if (pass1.toLowerCase()!="laura" & testV ==3)
history.go(-1);
return " ";
}
</SCRIPT>
<input type="button" value="View volunteer news" onClick="passWord()">

I know it is not very secure since the password is in the code, but that is fine with the user.
Any help would be appreciated. Let me know if you need more info.

Here is the page involved.
http://www.natures-nursery.org/volunteers_only.html
Darin McGrew
I'm moving this to the Client-side Scripting forum.
pandy
Seems you copied the code above from some place where it's still intact because it works.
ReBoot
QUOTE(pandy @ Sep 25 2009, 06:24 PM) *

Seems you copied the code above from some place where it's still intact because it works.


I copied the code right from the page http://www.natures-nursery.org/volunteers_only.html

Here is the home page. http://www.natures-nursery.org/index.html
If I click on the menu option "Volunteer News" and then the "View volunteer news" button it just takes me back to the home page.
It use to work and I have made no change to the code.
Could it be affected by the uses Internet options?
Donald

I have found away around the problem. Thank you!
pandy
I'm promted for the password and after I've entered the right one I'm taken to volunteer_news_a.html . If I enter the wrong password, after three tries I'm redirected back to the home page, if there's where I came from.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.