Can anyone please provide the correct javascript code for displaying the password onto a popup box when submit button is clicked
for eg.
if the password is typed as "yourock" which would be displayed as asterisks, when the submit button is clicked a pop up box is opened and the password is displayed as a real text.
The following is the html code that I wrote:
Code:
<?xml version = "1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<title> Page1 </title>
<link href="external.css" rel="stylesheet" type="text/css" />
<head>
<script type="text/javascript">
function checkPassword()
{
var password = myForm.elements["password"].value;
var message = "The password entered was '"+password+"'.";
alert(message);
}
</script>
</head>
<body>
<h1> Login Details </h1>
<p> Please login with your details</p>
<form name = "myForm" action="" method="POST">
<table border >
<tr>
<td> <b>User id </b></td>
<td><input type="text" name="Userid" </td>
</tr>
<tr>
<td><b> Password </b></td>
<td><input type="password" name="password" value=""></td>
</tr>
</table>
<br>
<input class = "submitbutton" type = "submit" value = "Submit" onclick = "return checkPassword()" />
<input class = "helpbutton" type = "reset" value = "Help" />
</form>
</body>
</html>
I have the javascript code, but it is working only for html, not for xhtml page that I have, Please clarify.
Thank You