user434885
user434885

Reputation: 2018

html password prompt

i have a javascript prompt box coming up i wan to use this for authentication, so i want the password entered to be masked, but i cannot find an option for this ? is it possible to do this ?

Upvotes: 0

Views: 2350

Answers (6)

Jan Sverre
Jan Sverre

Reputation: 4713

Do not use JavaScript as authentication, as it is easy to turn off javascript, and it is easy to modify it with FireBug or equal tools.

Use HTTP Authentication (HTTP 401) or some serverside script and HTML forms instead.

Upvotes: 1

Raghuram
Raghuram

Reputation: 52645

In html, you can do this by specifying <input type="password" ...>. Not sure what you are planning to put inside the javascript prompt box.

Upvotes: 0

m.edmondson
m.edmondson

Reputation: 30892

If you are absolutely sure you need a prompt box and not an input box you can set your server to require basic authentication - this forces the browser to prompt the user for username and password.

Upvotes: 0

Tom Gullen
Tom Gullen

Reputation: 61725

Any javascript password form with a hardcoded password/set of passwords is highly likely to be broken as this is a trivial task.

If it is using AJAX to check the password against the server, this is a better way of doing it but it is not clear in your question.

If you wish to display asterix in the field they enter the password this is done via:

<input type="password" />

Upvotes: -1

Olical
Olical

Reputation: 41372

Do you mean a text box with masked characters? Such as this.

<input type='password' name='password' />

Upvotes: 2

Babak Naffas
Babak Naffas

Reputation: 12561

Do you mean

<input type="password"/>

Upvotes: 0

Related Questions