PDA

View Full Version : Field validator with ajax, but need to detect if field is dirty (or modified) ?



SSzretter
12 Feb 2015, 4:39 PM
In my form panel, I have a field with a validator. Inside, I am performing an ajax call to my server to validate. In the on success, I am marking the field invalid or clearing the invalid.

This works great, except that I am finding the validator is called several times, even when the field has not actually been modified.

For example, when the form initially loads it's calling the validator 3 times! The second two calls, the field shows as dirty! I also tried comparing value and lastValue, but those seem to always be the same even when I changed the field.

How can I detect whether the field has actually been changed in the validator?