Carid
asked on
Validate dates using dd/mm/yyyy and dd mmm yyyy
I have a datagrid of fields where the user has to input date in the format of dd/mm/yyyy.
Once the date has been input it is then displayed in the format of dd mmm yyyy.
I want the validation to occur using the OnBlur event and if the date is correct then submit it to the server.
The validation will have to exclude empty date fields and any with the format of dd mmm yyyy.
thank you
Once the date has been input it is then displayed in the format of dd mmm yyyy.
I want the validation to occur using the OnBlur event and if the date is correct then submit it to the server.
The validation will have to exclude empty date fields and any with the format of dd mmm yyyy.
thank you
ASKER
Hi Zvonko
Can you tell me what the pattern or .match value would be for a date formatted as dd mmm yyyy.
I want to be able to exclude any dates with this format as this will be what will displayed when the validation has been completed.
thankyou
Can you tell me what the pattern or .match value would be for a date formatted as dd mmm yyyy.
I want to be able to exclude any dates with this format as this will be what will displayed when the validation has been completed.
thankyou
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you
My validation works now
I will give you the points
Cheers Cari
My validation works now
I will give you the points
Cheers Cari
if(theField.value=="" || theField.value.match(/^\d\
// excluded
}
Or if you need it inverted:
if(theField.value!="" && !theField.value.match(/^\d
// to be checked
}