why the hell the password matching funtion pwdCompare() is not working here ??and kindly tell me .. how to enabling the "forwarding" input box relating to radio button yes or no :( :( plz plz plz help me !!
<html>
<head>
<title>Email Control</title>
<link href="email-styles.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type = "text/javascript">
function pwdCompare() { // password matching function
var p1 = document.edit_email.password.value;
p1 = p1.replace(/^\s+/g, ""); // strip leading spaces
var p2 = document.edit_email.repassword.value;
p2 = p2.replace(/^\s+/g, ""); // strip leading spaces
if(p1 != p2)) {
alert ("The two passwords do not match!! Try again!");
document.edit_email.password.value = "";
document.edit_email.repassword.value = "";
document.edit_email.password.focus();
return false;
}
else {
alert ("The passwords match!");
}
}
</script>
</head>
<body>
<?php
include("config.php");
?>
<table width="600" align="center">
<tr>
<td>
<form name="edit_email" action="savedata.php" method="post">
<table width="600" border="0" cellpadding="0" cellspacing="5">
<tr><td class="emailtext">Password</td>
<td><label for="password"></label>
<input type="password" name="password" id="password"></td>
</tr>
<tr>
<td class="emailtext">Re-Type Password</td>
<td><label for="repassword"></label>
<input type="password" name="repassword" id="repassword" onBlur="pwdCompare()"></td>
</tr>
<tr>
<td valign="top" bgcolor="#FFFFFF" class="emailtext">Forwarding Mails</td>
<td bgcolor="#FFFFFF"><label>
<input name="radiobutton" type="radio" value="yes">
Yes</label>
<label>
<input name="radiobutton" type="radio" value="no">
<span class="emailtext">To</span>
<input type="text" name="forwarding" id="forwarding"></td>
</tr>
<tr>
<tr>
<td colspan="2" align="center" bgcolor="#FFFFFF"><input type="submit" name="submit" id="submit" value="SAVE">
<label>
<input type="button" name="back" value="Back" onClick="window.location.href='index.php'">
</label></td>
</tr>
</table>
</form>
</td></tr>
</table>