
October 29th, 2004, 04:10 PM
|
|
Contributing User
|
|
Join Date: Sep 2004
Posts: 66
Time spent in forums: 12 m 4 sec
Reputation Power: 6
|
|
|
javascript multiple validation email and ss#
i have a form that asks for email address and social security number. my validation for the email address is basic but is all that i need. this question is about the ss#. sometimes this number will be nnn-nn-nnnn and sometimes it will be nn-nnnnnnn (for fein #'s). so i need a script to check basically that 9 digits were entered and then i need to validate the email script AND the ss#.
Current script-
Code:
<script Language="JavaScript">
<!--
function DataValidation()
{
if (document.talentedit.e_email.value.indexOf("@")==-1 && document.talentedit.e_email.value!="") {
alert("Please enter a valid e-mail address!");
talentedit.e_email.focus()
return false;
}
return true;
}
// -->
</SCRIPT>
...
<input type="submit" name="Submit" value="Submit" onClick="return DataValidation();">
Thanks!
|