i have few queries regarding valdations check ,
1)i have to check a feild which allows alphanumeric and < this symbol ,i tried by putting text check point with some regular expression but it is not working correctly,the main problem is with < this symbol how to put regular expression for this
2)also there is a date of birth feild .i want to compare the date selected by user and current date ,if the age is greater then 18 user will be allowed to register else not???
so how to get and compare today's i mean current date and selected date
1. what reg expression have you tried..??
2. Are you able to retriee the selected date from the application..?? if yes then compare that with the current date(look into help for date functions)
I did not understand the relation between age and date in your second query
See the below code, here i used GLOBAL_OBJECT to represent Browser().Page().Frame() Don't get confused.
with this you can also use < char to check for.
For 2nd issue u may need to use DATE functions.
Set WshShell = CreateObject("WScript.Shell")
' Check for the char entered into the edit field.
If strVal="1" Then
Msgbox "PASS-Accepts only numeric characters"
If strVal="1b" Then
Msgbox "FAIL-Accepts alphanumerics"
If strVal="b" Then
Msgbox "FAIL-Accepts only alphabets"
thank dear for above code i will try and let u know if it worked or not,thank a lot for finding ur precious time for my query
about point 2--->
i mean to say that .i have a registration form for banking application in which only person having age more then 18 years are allowed to register
in order to check to age we have Date of Birth feild of format:- Data/month/year user will select date of his birth i have to put check that by his date of birth ,i have to calulate age if it is more then 18 it is pass if less it is fail
so to do so i need to compare cureent date/month/year with user date of month.
eg: today is 13/july/2008
date of birth of user=14/april/1984
so if 13/july/2008-14/april/1984=18 years test is pass else fail
so My question is how can i get current date/year/month and perofm required check???