0

actually i want to compare pass1.value with pass2.value...dis is my code please check it..

<html>
<head>

<script type="text/javascrpit">

function myFunction()
{
alert " pass1.value";
var x=document.getElementById("pass1").value;
var y=document.getElementById("pass2").value;
if(x == y)
{
alert "password matches";
}
else
{
alert "password dosn't matches";
}
}

</script>
</head>
<form name="mailform" method="POST" action="#">
<table>
<tr>
<td>Password:<sup style="color: red;"></sup></td>
<td><input name="pass1" id="pass1" type="password"></td>
</tr>
<tr>
<td>Re-Type Password:<sup style="color: red;"></sup></td>
<td><input name="pass2" id="pass2" type="password"></td>
</tr>
</table>
<input type="submit" value="submit" onsubmit="myFunction()">
</form>
<div id="abc" style="display:none; color:#FF0000;">
<table>
<tr>
<td id="one">
</td>
</tr>
</table>
</div>
</html>
3
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by subramanya.vl
0

The brackets are missing after the "alert" command.
The line numbers 8, 13 and 17 should be corrected.
8. alert " pass1.value";
13. alert "password matches";
17. alert "password dosn't matches";

The above lines of code should be corrected as below

8.  alert(pass1.value);
13. alert("password matches");
17. alert("password dosn't matches");
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.