EasyUI Forum

General Category => EasyUI for React => Topic started by: chrwei on October 16, 2019, 10:35:56 AM



Title: Form validation rules changes
Post by: chrwei on October 16, 2019, 10:35:56 AM
I'm trying to change the validation based on the data entered.  I have my rules object in the state, and setState to change them, and using Chrome's React Developer Tools I can see my changes, but "validate(errors => {...}) still gives errors for the original rules.

how can i make fields required or optional depending on the choices of other fields?


Title: Re: Form validation rules changes
Post by: chrwei on October 16, 2019, 10:47:52 AM
I figured out a work around, I was not rendering the FormField that was wanting to not validate, but this left it in the model and rules somehow.  putting a display:none style on the FormField instead fixed this.