How can I hide the password entered by a user in a dialog prompt in JavaScript? For example, using something like this:
function ConfirmIt()
{
var control4 = '<%=HiddenDelete.ClientID%>';
if (document.getElementById(control4).value == "True")
{
var x = prompt('Enter your Password ')
var control = '<%=HiddenField2.ClientID%>';
if (x !== "") {
document.getElementById(control).value = x;
}
else {
document.getElementById(control).value = "0";
}
}
else
{
alert("No Permission");
}
}
I would like that when e.g. 12345 is entered it appears like ***** or ..... in the dialogue box. After that I want to select the password in a hiddenfield. Can anyone suggest how I can do this or provide some example code?
Simple option is make the filed as password type
<input type="password" name="pwd">
It is better and easy to use Jquery Popup window or Dialog box if you are looking for a popup type window which will support with the password fields.
If you really want to stick into prompt then try this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With