I've got a sign up form that requires the user to enter their email and password, both are in two separate text boxes. I want to provide a button that the user can click so that the password (which is masked) will appear in a popup when the user clicks the button.
currently my JS code for this is as follows:
function toggleShowPassword() {
var button = $get('PASSWORD_TEXTBOX_ID');
var password;
if (button)
{
password = button.value;
alert(password);
button.value = password;
}
}
The problem is that every time the user clicks the button, the password is cleared in both firefox and IE. I want them to be able to see their password in clear text to verify without having to retype their password.
My questions are:
1) why does the password field keep getting reset with each button click
2) how can I make it so the password field is NOT cleared once the user has seen his/her password in clear text?