When i console.log(this.isFormValid);
Result :
ƒ isFormValid() {
return this.errors.length == 0;
}
`import ValidationComponent from 'react-native-form-validator';
export default class extends ValidationComponent {
constructor(props) {
}
// onPress of the Submit button I am invoking this function to validate all my fields.
submitCredentials = () => {
// TODO : Get the Location details
// TODO : Validate the type of data in the Regsiter Form
// TODO :
console.log("Validating the Form");
this.validate({
_password : {required: true},
_email : {email: true}, // Sample: I am entering the "sdfjhsbdjfh" in the email field
_name : {required: true},
_lastname : {required: true},
_phone : {numbers: true},
_alias_name : {required: true},
_isd : {required: true},
})
console.log(this.isFormValid); // returns the function on console
if(this.isFormValid){ // Always true even if incorrect data is entered in form.
this.fireRegisterAPI();
}
}`
Please help with the solution. What am I missing here? Any setup issue?
TIA
When i console.log(this.isFormValid); Result : ƒ isFormValid() { return this.errors.length == 0; }
`import ValidationComponent from 'react-native-form-validator';
export default class extends ValidationComponent { constructor(props) { }
// onPress of the Submit button I am invoking this function to validate all my fields. submitCredentials = () => {
}`
Please help with the solution. What am I missing here? Any setup issue? TIA