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
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
In the Web page we have a table link, if we click on that link all the contents under that link will be sorted (asscending/Descending). Now i want to check in which order the list is ? for that i need to get the data in to some var How can i get that cells data?
Please let me Know regarding any material regarding VB Scripting which should be easily understandable for Beginners.
How will you get the smallest subscript of an array in vbscript?
what is event handling?
Explain the string concatenation function in vbscript?
Write a code to print numbers from 5 to 0?
Mention if qtp generates vbscript code as we record actions, can't it possible to directly write using vbscript code when qtp does the same thing too?
What are keywords in the vbscript language?
How will you format a number in percetage format in vbscript?
What aspects of vbscript make it safe so that a web page using vbscript cannot destroy or corrupt information on a user's computer?
how to write codings in QTP using vb script. please help me. i am new to QTP. it is easy or very much tough. please tell me
How are values assigned to the variables in the vbscript language?
Which keyword is used to declare a variable in the vbscript language?
Mention how to assign a date value to a variable?