Hello,
I've a custom validator that is validating a custom popup editor template in a grid.
The problem I'm facing is that when I set a value in a NumericTextBoxFor() field and the validator fails (return false) then the value isn't written in the popup editor's model so when I write in the same field the value I had previously written the validator's message isn't hidden.
Example:
- I write "24" in the field. (the validator returns true and the model contains "24")
- I write "-1" in the field. (the validator returns false and the model still contains "24"). I think this is the problem, even when the validator returns false the model must be updated with "-1" but instead it ignores the new value so the model still contains "24". At this point the validator's message is shown.
- I write again "24" in the field. (the validator returns true but the model already contained "24") so the validator's message isn't hidden even when "24" is a valid value
- I write another value valid for the validator. (the validator returns true and the model contains the new value). At this point the validator's message is hidden.
How can I solve this problem?
Thank you.