> I'm trying to use the TMT validator to validate a text field which needs > to > contain just a year. > > For some stupid reason the client doesn't want to use a dropdown (which is > dead simple) and insists on being able to type in the date manually. I > told > him that eventually someone is going to want to type in a 2 digit year. So > I'm left with trying to validate "1997" as opposed to "97". > > I've got this line in place on the text field: > > tmt:datepattern="YYYY" > > And I'm typing in the full year but it's not working properly. Does anyone > have any ideas? Is this going to require a custom filter?
Custom date validation still require day and month: http://www.massimocorner.com/validator/samples/custom_date_validation.htm Sounds like you need a custom pattern: http://www.massimocorner.com/validator/samples/custom_pattern.htm Something along these lines (I haven't test it!): <script type="text/javascript"> tmt_globalPatterns.year = new RegExp("^\([0-9]{2,4}\)$); </script> ---------------------------- Massimo Foti Tools for ColdFusion and Dreamweaver developers: http://www.massimocorner.com ---------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:231790 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54