EasyUI Forum
April 26, 2024, 06:50:23 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Form validation rules changes  (Read 4503 times)
chrwei
Full Member
***
Posts: 219


View Profile Email
« 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?
Logged
chrwei
Full Member
***
Posts: 219


View Profile Email
« Reply #1 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.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!