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, bu开发者_开发问答t i cannot find an option for this ? is it possible to do this ?
Do you mean a text box with masked characters? Such as this.
<input type='password' name='password' />
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.
Do you mean
<input type="password"/>
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.
In html, you can do this by specifying <input type="password" ...>
. Not sure what you are planning to put inside the javascript prompt box.
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" />
精彩评论