sophielois
Technical User
Hi,
im trying to make sure that users input there correct email address by asking them to enter it twice and checking that what they have entered matches. If they have entered it incorrectly twice well hey what can i say.... anyway this is all i have at the minute, ive never attempted to do this so any advice would be grand!!
form:
validation script
ta Soph
im trying to make sure that users input there correct email address by asking them to enter it twice and checking that what they have entered matches. If they have entered it incorrectly twice well hey what can i say.... anyway this is all i have at the minute, ive never attempted to do this so any advice would be grand!!
form:
Code:
<table class="contact" style="width:297px; margin-left:0px;" cellpadding="5" cellspacing="0" id="form">
<form method="POST" action="subscribe.php" name="form">
<tr>
<td width="54%" valign="middle"> Full Name:</td>
<td width="46%" align="right" valign="middle"> <input name="fullname" type="text" id="fullName11">
</td>
</tr>
<tr>
<td valign="middle"> Email Address:</td>
<td align="right" valign="middle"> <input name="email" type="text" id="emailll" ></td>
</tr>
<tr>
<td valign="middle"> Confirm Email Address</td>
<td align="right" valign="middle"> <input name="email1" type="text" id="email1" ></td>
</tr>
<tr>
<td> </td>
<td align="right"> <div align="right">
<input type="submit" name="Submit2" value="Subscribe" onClick="return validate(form)">
</div></td>
</tr>
</form>
</table>
validation script
Code:
<script language="JavaScript">
<!--
function validate(form) {
if (form.fullname.value.length == 0)
{
alert("Please enter your full name.")
form.fullname.focus()
return false
}
if (form.email.value.length == 0)
{
alert("Please enter your e-mail address.")
form.email.focus()
return false
}
if (form.email.value.indexOf("@") == -1)
{
alert("Please enter a valid e-mail address.");
form.email.focus();
return false;
}
}
//-->
</script>
ta Soph