Last post Oct 31, 2009 02:19 PM by sjnaughton
Oct 28, 2009 04:23 PM|Kyle.Savant|LINK
How can you accomplish custom CLIENT-SIDE validation to dynamicfields and dynamiccontrols? Can this be done in the model using attributes; similar to the RequiredAttribute. [Required("*")]
I have a boolean and a date. If the boolean is checked, the date must be entered. Simple validation. Can this be done in the model metadata?
Oct 29, 2009 07:16 AM|sjnaughton|LINK
Hi Kyle, most of the validators have client side enabled, but I havnet found any client side validation code for dates that is satifactory and is i18l but you certanly can provide you own client side validation. what I do for dates is use the AJAX toolkit
date picker, which avoids having to do the validation. ofcourse if you want to make sure the dates are in a specific range then thats different [:(]
Oct 29, 2009 08:34 AM|Kyle.Savant|LINK
and validate that way. Just wish there were a better way. Better yet, there definitely
should be a better way. I hope this is baked into 4.0.
As for dates I created a new DateTime field template(reference via UIHint) and added a validator control. In my case, I do use the AJAX date picker which works fantastic. However, in some cases, future dates are not allowed. So in my field template I add
I would use this method for my other custom validation, yet, the problem is that the other validation deals with multiple controls and field templates only handle one control. BLAH!!!!
P.S. - I have been looking into setting up a blog site. I'll keep you posted.
Oct 31, 2009 02:19 PM|sjnaughton|LINK