예제 #1
0
 public void Validate(NestedModel state, IFormContext formContext)
 {
     if (state.Selection != "Washington" && formContext.TryGetFormField("stateInput", out IFormField selectionData))
     {
         selectionData.IsValid           = false;
         selectionData.ValidationMessage = "Washington!!!!!!!";
     }
 }
예제 #2
0
        public void Validate(Model state, IFormContext formContext)
        {
            _nestedReducer.Validate(state.Nested, formContext);

            if (state.Age < 12 && formContext.TryGetFormField("ageInput", out IFormField ageData))
            {
                ageData.IsValid           = false;
                ageData.ValidationMessage = "You must be 12 to ride this amusement park attraction";
            }
        }