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 / mudaseer

vmail=inputbox("enter the value")
vstr=right(vmail,3)
if len(vmail)>25 then
msgbox "length is too high"
elseif instr(vmail,"@")=0 or instr(vmail,".")=0 then
msgbox "invalid-@ or . is absent"
elseif (instr(vmail,"@")-1)<3 then
msgbox "invalid-length to less"
elseif not(vstr="org" or vstr="com" or vstr="net") then
msgbox "invalid-domain not correct"
else msgbox "valid"
end if

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between vbscript and vba?

697


How to take whole text output from screen of Bitmap Application.

1942


What is vbscript language used for and which earlier language is it modeled upon?

626


1. How do declare public variable in vb scripts?

1675


Write a Program to add 2 numbers without using operators (+,-) and without using third variable. Note: Use VBScript only Hint: You can use other operators like '/' & '*'(Division & Multiplication)

3269






What is Procedure or Subroutine in VB Script?

703


while using Keyward driven framework in QTPif new requirements are added how to manage it...plz ans

1671


What is loose binding? Why is it not a good practice to use it?

735


I have an excel sheet with multiple ID's in a column. Now i need fetch those ID's in an application and check whether if it already exist in the DB. If not then i have to go with the process of inserting them in the DB. If it exists then i need to skip that ID and move to the next ID and check the same and proceed. How can i do that with for loop and if condition?

964


how to comvert 120 into one hunderd twenty rupees only and vice varsa

1904


How to pass argument by reference to a function in vbscript?

635


how to check whether link is disabled in QTP??

5708


Out of the different type of operators, which are evaluated first and last in the vbscript language?

666


What is difference between vbscript and vba?

702


Which conditional statement is the most convenient one to use in the case of multiple conditions in the vbscript language?

604