Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Validation on Date Field in Datacapture Form
System
Hi All,
I have a date field in data capture form.
I want the format of date entered here as Month DD, YYYY
Example: May 01, 2002
I convert the date entered here to yyyymmdd, and use it for sorting my press releases.
I want to do validation of the data entered here.
How can I do validation in datacapture to make sure the entered date is in the format Month DD, YYYY?
Thanks,
Ravindra
Find more posts tagged with
Comments
akshathp
I haven't tried it but thought of sharing as how about using this:
<text required="t" maxlength="20" validation-regex="^.* [0-3][0-9],[0-9][0-9][0-9][0-9]$" />
Hope this helps!
Akshat Pramod Sharma
Interwoven Inc.
Johnny
an item such as this would meet your needs
<text size ="20" maxlength="40" required="t" validation-regex="^\w+\s\d\d\,\s\d\d\d\d$" >
<default>mon dd, yyyy</default>
</text>
i recommend you use a calendar callout, (you can find one on this site). That way the user doesnt have worry about the format, and you can manipulate it in your tpl anyway you like.
<text size ="20" maxlength="40" required="t" validation-regex="^[0-3][0-9]\/[0-1][0-9]\/20[0-9][0-9]$" >
<default>dd/mm/yyyy</default>
<cgi-callout
url="/iw-bin/iw_cgi_wrapper.cgi/calendar.ipl"
label="Calendar"
window-features="width=200,height=230,resizable=no,toolbar=no,scrollbars=no,titlebar=no"/>
</text>
Edited by Johnny on 11/07/02 01:38 PM (server time).
Adam Stoller
For pretty thorough date validation regex - check out
KB 45818
on the Support site.
Granted - it is doing a fully numeric validation - but you could enhance it to use (January|February|...|Jan|Feb|...|Dec) instead of numbers for the first part of the field.
--fish
(Interwoven Senior Technical Consultant)