accept an email id & validate it .email id should not exceed
25 characters the mail id should contain 3 characters
excluding domain name,@ and .(dot) the last 3 characters
of the domain should be net,com or org
Answer Posted / pankaj jaju
Function IsValidEmail(strEmail)
If Len(strEmail) > 25 Then
IsValidEmail = "Email contains > 25 characters"
ElseIf LCase(Right(strEmail, 4)) <> ".net" AND LCase
(Right(strEmail, 4)) <> ".com" AND LCase(Right(strEmail,
4)) <> ".org" Then
IsValidEmail = "Email contains invalid
domain name. Use only .com or .net or .org domains only"
ElseIf UBound(Split(strEmail,"@")) > 1 Then
IsValidEmail = "@ character is used
multiple time"
ElseIf UBound(Split(strEmail,"@")) < 1 Then
IsValidEmail = "@ character is missing"
Else
IsValidEmail = True
End If
End Function
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain about filter expression?
Why is the use of exit do or exit for statements within loops discouraged?
In html file what is an ideal position to include vbscript?
What is the scope of a constant declared using public?
Explain the scope of the variables using dim, public, and private keywords respectively.
Anyone have qtp11.0 crack?
after medical test,when will be the police verification
What is the use of the date function in the vbscript language?
How will you get the largest subscript of an array in vbscript?
What are class events?
How are values assigned to string type and numeric type variables?
Give me sm ideas to write Vbscripts abt protocol testing abilash700@gmail.com.
how to operate webobjects in a webpage using getobject function and then using generic methods?
Which keyword is used to declare a variable in the vbscript language?
i am having some basic knowledge in c and VB 6.0. i qtp i want to know how to write the codings. by recording it is generating lot of codings. for example i want to test the text box. senerio is text box should not accept alphabets if it accept alphabets we should return fail status if it get number we should return pass status. how to write coding in vb script please help me