react-native-form-builder icon indicating copy to clipboard operation
react-native-form-builder copied to clipboard

Trigger validation on button clcik

Open DalbirKaur opened this issue 7 years ago • 1 comments

I am unable to show validation message on button click. Kindly let me know how can I achieve this.

DalbirKaur avatar Nov 01 '18 11:11 DalbirKaur

this code will work


  // Returns the values of the fields and auto Validate
  getValuesValidate() {
    const values = {};
    Object.keys(this.state.fields).forEach((fieldName) => {
      const field = this.state.fields[fieldName];
      if (field) {
        values[field.name] = field.value;
      }
      this.onValueChange(field.name,field.value);
    });
    return values;
  }

Q8hma avatar Dec 22 '18 09:12 Q8hma