Password protection help

  • Carpdung
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Nov 14, 2003
  • Posts: 11
  • Status: Offline

Post November 14th, 2003, 8:37 am

Hi there,

I recently placed a simple password protection Javascript into an html code and it works fine. However, when the user types the password it shows up. How do I keep the password from being displayed?

I know that within forms I can set type="password", but not sure how to do it in this case.

Thanks for the help!
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post November 14th, 2003, 8:37 am

  • sartori
  • Novice
  • Novice
  • No Avatar
  • Joined: Nov 06, 2003
  • Posts: 17
  • Status: Offline

Post November 14th, 2003, 12:06 pm

I watched someone do this in Java... it was something like
Code: [ Select ]
localecho = "*"
and that worked for him. That is my 2 cents
Sart!
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Joined: Jun 15, 2003
  • Posts: 4583
  • Loc: Maryland
  • Status: Offline

Post November 14th, 2003, 12:50 pm

could you please copy the script so we could see what it looks like?

(the java example wont work, as JavaScript and Java are two completely different languages, you were right with the password type, just gotta show you where to put it)
Pixel Acres V2
  • Carpdung
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Nov 14, 2003
  • Posts: 11
  • Status: Offline

Post November 14th, 2003, 3:57 pm

Hello all,

I tried implementing the

localecho = "*"; but the password continued to show up. Below you'll see a sample of the code: (This was a free source taken right off the internet. Works like a charm, but I just need the user's input to output "*" rather than what they are truly typing. Any help is appreciated. Thanks!
===================
<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function password() {
var testV = 1;
var pass1 = prompt('Please Enter Your Password','');
localecho = "*";
while (testV < 3) {
if (!pass1)
history.go(-1);
if (pass1 == "password") {
alert('You Got it Right!');
window.open('cod_resolution.html');
break;
}
testV+=1;
var pass1 =
prompt('Access Denied - Password Incorrect, Please Try Again.','Password');
}
if (pass1!="cod4u" & testV ==3)
history.go(-1);
return " ";
}
// End -->
</SCRIPT>
==========================
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Joined: Jun 15, 2003
  • Posts: 4583
  • Loc: Maryland
  • Status: Offline

Post November 14th, 2003, 4:09 pm

you can't do prompts with astricks, you'll have to either do it with a form, or live without the astricks.
Pixel Acres V2
  • Carpdung
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Nov 14, 2003
  • Posts: 11
  • Status: Offline

Post November 14th, 2003, 6:15 pm

Hi B_heyer,

Thank you for helping me out. :)

That is my issue, trying to make the password appear as asterisks when typed. Basically, what I'm trying to accomplish is a Page that prompts you for a password before you can enter. Is there an easy way I can do this? :?:

Thanks again :)
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Joined: Jun 15, 2003
  • Posts: 4583
  • Loc: Maryland
  • Status: Offline

Post November 14th, 2003, 7:42 pm

are you using a free or payhost?
Pixel Acres V2

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 164 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.