We have 2 input textfields on the screen whose combination makes up a valid entry. We are doing remote validation on both of them.
Our ViewModel:
[Remote("IsExampleValid", "Validation", AdditionalFields = "Field2")]
public int Field1 { get; set; }
[Remote("IsExampleValid", "Validation", AdditionalFields = "Field1")]
public int Field2 { get; set; }
The problem is these still fire separately and do not truly act together like we need. For example, if I enter bad data in both of them to make an invalid entry then they both will have an error. If I change Field2 to make a valid combination, the remote validation method will get called and mark Field2 as valid. However, Field1 will still be invalid. Field1 should be valid though because they are a combination. Is there a better way to do 2 fields that make up a valid combination?