Hi Guys,
Im creating a database application and working on various data entry cards. one of the things I need to do is validate data entered in certain fields is formatted correctly. One such type of data is dates. What is the most efficient way (also the simplest for a newbie) to have an input mask on a field which can accept a dd/mm/yyyy format? I'm using the DatePicker extension, so 9 times out of 10, dates will be correct, but I need to be aware that a user may type in a date and I need to make sure its in xx/xx/xxxx format. Any help would be much appreciated
Thanks all
Jalz
date input and validate
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: date input and validate
Hui Jaz,
you could script a "closefield" handler whcih checks the content.
Quick & dirty example:
You get the picture
Best
Klaus
you could script a "closefield" handler whcih checks the content.
Quick & dirty example:
Code: Select all
on closefield
put me into tContent
## 1. check for correct items
set itemdel to "/"
if the num of items of tContent <> 3 then
answer "Idiot!"
put empty into me #or any other punishment
exit closefield
end if
## OK Now check the three items:
if the num of chars of item 1 of me <> 2 then
### Wrong day format, hurt user NOW!
end if
## etc......
end closefield

Best
Klaus
Re: date input and validate
Hi Klaus,
Thank you, how do you remember all this stuff
Certainly put me on the right track, including another post you replied to for someone else. Much appreciated.
Jalz
Thank you, how do you remember all this stuff

Certainly put me on the right track, including another post you replied to for someone else. Much appreciated.
Jalz