gcook1
01-10-2006, 09:28 AM
I do a simple email check on some internal forms. I just check for the existance of the @ sign. Here's my problem... if someone enters multiple emails and only one is valid, my check says it's ok. Here's the code I use. strEmail is the textbox the user enters emails into.
function MyForm_OnSubmit
validation = True
If(document.MyForm.strEmail.Value) = "" Then
MsgBox("An E-mail address is required")
validation = False
Elseif(InStr(1,document.MyForm.strEmail.Value,"@",1)<2) Then
MsgBox("The To: Email address is invalid")
validation = False
End If
If validation = True Then
MyForm_OnSubmit = True
Else
MyForm_OnSubmit = False
End if
So how would you handle multiple email situations?
function MyForm_OnSubmit
validation = True
If(document.MyForm.strEmail.Value) = "" Then
MsgBox("An E-mail address is required")
validation = False
Elseif(InStr(1,document.MyForm.strEmail.Value,"@",1)<2) Then
MsgBox("The To: Email address is invalid")
validation = False
End If
If validation = True Then
MyForm_OnSubmit = True
Else
MyForm_OnSubmit = False
End if
So how would you handle multiple email situations?