hello i am trying to make a registration page for my school project .
I wrote a simple script that would check if my password and comfirmpassword fields match . Something is wrong , it always says unmatching password fields.
below are my codes
[CODE] <form name=”registration” action=”register.php” method=”post” onsubmit=”return checkData()”>
<table width=”417″ border=”0″>
<tr>
<td><font class=”duzyazi”><strong>Username:</strong></font></td>
<td><input name=”username” type=”text” class=”textarea” size=”30″ /></td>
</tr>
<tr>
<td><font class=”duzyazi”><strong>E-Mail Address:</strong></font></td>
<td><input name=”email” type=”text” class=”textarea” size=”30″ /></td>
</tr>
<tr>
<td><font class=”duzyazi”><strong>Confirm E-mail Address:</strong></font></td>
<td><font class=”duzyazi”><strong> </strong></font>
<input name=”confirmemail” type=”text” size=”30″ class=”textarea”/></td>
</tr>
<tr>
<td><font class=”duzyazi”><strong>Password: </strong></font></td>
<td><input name=”password” type=”text” class=”textarea” size=”30″ /></td>
</tr>
<tr>
<td><font class=”duzyazi”><strong>Confirm Password:</strong></font></td>
<td><input name=”confirmpass” type=”text” class=”textarea” size=”30″ /></td>
</tr>
<tr>
<td><input type=”submit” value=”RESIM” name=”register” /></td>
<td> </td>
</tr>
</table>
<br />
<br /><br />
</form>
and
[CODE]function checkData()
{
if(document.registration.username.value==””)
{
window.alert(“You can`t leave the username field blank!.. Please enter a valid Username”);
return false;
}
else if(document.registration.email.value.indexOf(“@”)==-1)
{
window.alert(“Please enter a valid Email Address”);
return false
}
else if(document.registration.password.value=””)
{
window.alert(“Password field can not be blank!”);
return false;
}
else if(document.registration.email.value!=document.registration.confirmemail.value)
{
window.alert(“Unmatching Email fields”);
return false;
}
else if(document.registration.password.value!=document.registration.confirmpass.value)
{
window.alert(“Unmatching password fields”);
return false;
}
else{
return true;
}
}
other parts works fine , i just have problem with the password fields , i probably am missing something very wasy.
thanks