I am running this validation between two fields. Origin and Destination.
fd.spRendered(function () { fd.field('Origin').addValidator({ name: 'Origin', error: 'This is a domestic travel. Please close and submit a domestic travel request.', validate:function(value){ if(fd.field('Origin').value.lookupvalue == fd.field('Destination').value.lookupvalue ){ return false; } return true; } }); });
It returns the error when the same country is selected. However, it does not refresh when I select another country.
For example:
In Destination: I selected Angola.
In Origin: I selected Angola again.
I got the correct error. "This is a domestic travel. Please close and submit a domestic travel request"
When I changed the Origin to Aruba, I still have the error. It does not refresh.
Can you please help me? Thank you!