Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Validating Metadata
nickcolorado
I have two fields that are on my metadata capture form: review_date and end_date. I need to validate that the review_date is before the end_date and that the end_date is not earlier than today's date. Can anyone give me some guidance on how I can accomplish this validation when the user clicks the 'save' button on the MetaData capture form? I looked into running some MT Rules, but that doesn't appear to be an option. THANK YOU!
Nick
Find more posts tagged with
Comments
Adam Stoller
Unfortunately, the 3.5x version of MetaTagger does not provide FormAPI support (nor does the 5.5.2 OOTB TeamSite metadata capture form) - so probably the best you could do is perform some post-validation of the metadata by way of an externaltask or cgitask script in a workflow.
I *think* the TeamSite 6 / next version of MetaTagger (not sure if the version numbers are getting synchronized) may provide the FormAPI functionality within the metadata capture form - so if you need the functionality now - implement the workflow (or custom menu item) script validation process now, but look to being able to replace it with more built-in functionality later.
--fish
(Interwoven Senior Technical Consultant)
jamesAbel
We had this issue as well. RegEx helps validate a date to a certain point, but not granular enough for what we were looking for -- also didn't want the users to have to manually enter the dates.
Ending up solving as:
For each date field, there is both an inline callout and a cgi-callout. The inline callout is an .ipl that takes a few simple parameters to allow the date to be defaulted to a number of items: x months from now, x years from today.
For the cgi-callout, it creates a javascript calendar on an HTML page. This also takes parameters of: must be earlier than today's date (this was a specific requirement), must be at least x months from today, must be no more than x months from today (limit the number of months until the expiration of a document). With these parameters, the javascript then dynamically checks the date as the user selects it - popping an alert up when they enter a bad date.
This method still has the drawback of: the user can go and modify the date in the text field after the date is selected from the call-out. We have not addressed this yet, but will probably put some date-checking logic into our workflows (a task that validates the dates).
If you would like, I can email you the code for the callout we created (it most likely isn't too well commented, but you would be welcome to check it out).
milind
If javascript doesn't work in metadatacapture form then what can be alternate ways to validate data provided by user?
nipper
Regex is the only way at the moment. 6.7.1 with a SP (I think) is supposed to include the DCT support of FormAPI.
Regex should work for simple vaildation. However if you are looking at the more complex things you can do with templates, no such luck.