I am trying to validate a webmaskeditor using a regularexpressionvalidator but with no avail!
My mask editor needs to input time in the format 00:00:00 (hh:mm:ss) and my time format is 24hr. My Regular expression is ([0-1]\d|[2][0-3])\:[0-5]\d\:[0-5]\d but it still won't work even though my ControlToValidate property has been set to the maskeditor. How do I go about making sure it validates it?
Hi,
The validation of WebTextEdit is binded with the Value (on server) and getValue (on client), but not with getText. In case of WebMaskEdit the value is defined by DataMode property and default is RawTextWithRequiredPrompts. That means that static literal characters are skipped and only pure data is considered (like only numbers in telephone or SS).
So, to configure validators application need to comply with those rules. In that particular case, you have 2 choices:
1. Keep default DataMode and remove static characters from your expression: ([0-1]\d|[2][0-3])[0-5]\d[0-5]\d
2. Keep your expression and change DataMode to AllText (or to similar value which includes literals)