|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Simple Email Validation :
I have a form with a textbox called txtEmail Below is the code to validate the email Address for the @ sign and the Period. If the email address does not contain the @ sign and period the message box is displayed Private Sub txtEmail_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtEmail.Validating 'VALIDATE THE EMAIL ADDRESS FOR THE @ SIGN AND PERIOD Dim strEmail strEmail = txtEmail.Text If txtEmail.Text = "" Then Exit Sub End If If strEmail <> "" And InStr(strEmail, "@") <> 0 And InStr(strEmail, ".") <> 0 Then Exit Sub Else MsgBox("Email Address Is Missing:" & (Chr(13)) & "__________________________________________________ " & (Chr(13)) & " " & (Chr(13)) & "The @ Sign" & (Chr(13)) & " " & (Chr(13)) & "And/OR The Period ( . )" & (Chr(13)) & " " & (Chr(13)) & "Correct To Continue " & (Chr(13)), MsgBoxStyle.OKOnly, "Invalid Email Address") txtEmail.Focus() Exit Sub End If End Sub ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > Email Validation Code |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|