I have a date field which should be lesser than current date. I have used validation code in the validate event which returns either true or false and based on that error message gets displayed, which is all working fine.
Now if the validation fails, I want to reset the field which is not happenning in my case.
You could include a line as part of the validation script:
this.rawValue = null;
So that if validation fails, the message will display and then the field will be cleared.
Hope that works,
By doing so, the field is getting cleared but the message is not displaying.
Suppose lets take a case of email validation.
I have used the following code in the validate event
r = new RegExp();
result = r.test(this.rawValue);
(result == true)
In this code if i use this.rawValue=null after or before "false" ,error message is not getting displayed.
PS: Validation part is working absolutely fine.
I think the issue is that the value of the selection is not complete when you are validating, try the exit event. Also try resetting the date:
Hope that helps,