Password protection help

  • Carpdung
  • Newbie
  • Newbie
  • Carpdung
  • Posts: 11

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • sartori
  • Novice
  • Novice
  • sartori
  • Posts: 17

Post 3+ Months Ago

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
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

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)
  • Carpdung
  • Newbie
  • Newbie
  • Carpdung
  • Posts: 11

Post 3+ Months Ago

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
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

you can't do prompts with astricks, you'll have to either do it with a form, or live without the astricks.
  • Carpdung
  • Newbie
  • Newbie
  • Carpdung
  • Posts: 11

Post 3+ Months Ago

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
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

are you using a free or payhost?

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 54 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
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.