I'll have a wide ranging audience who will be completing various forms I deliver.
I have date fields that offer the date chooser of course and the pattern is set to DD/MM/YYYY.
However, some of my users tend to enter dates any way they like - eg. 280511 or 28.05.11 or 28/5/11, etc.
These 3 are the most common varieties. When they enter any of these, the field accepts their entry as is.
Apart from a Tooltip, prompt or help text or whatever to tell them how to enter the field, what script could I use to convert the above 3 types of entry into the correct date format?
Thanks,
Peta
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Peta,
You can achieve this by leaving the display pattern of the date/time field as: date{DD/MM/YYYY}.
Then in the edit pattern you would specify all of the possible combinations that users input dates:
date{DD/MM/YYYY}|date{DD.MM.YY}|date{DD.M.YY}|date{D.M.YY}|date{D.MM.YY}|date{DDMMYY}
Each pattern is separated by a |.
Hope that helps,
Niall
Views
Replies
Total Likes
Hi Peta,
You can achieve this by leaving the display pattern of the date/time field as: date{DD/MM/YYYY}.
Then in the edit pattern you would specify all of the possible combinations that users input dates:
date{DD/MM/YYYY}|date{DD.MM.YY}|date{DD.M.YY}|date{D.M.YY}|date{D.MM.YY}|date{DDMMYY}
Each pattern is separated by a |.
Hope that helps,
Niall
Views
Replies
Total Likes
Hi Niall,
Well now there's a funny thing. In Design view it displays an 'invalid pattern' message. Yet I could see the separators were correct. So I gave it a go anyway and despite the error message in Design view - it works a treat.
Thanks again Niall
Views
Replies
Total Likes
Hi Peta,
You should not get an error in the design view. I think it would be a good thing to recheck the edit pattern. Make sure that there isn't a surplus |, either at the begining or end of the string. Also double check that each individual pattern is correct and complete, eg date{DD.MM.YY}
At least you are closer to a solution,
Niall
Views
Replies
Total Likes
Views
Likes
Replies