lcFormValidation icon indicating copy to clipboard operation
lcFormValidation copied to clipboard

Update readme

Open manuumv opened this issue 6 years ago • 0 comments

In the Validating the entire form example the viewModel is { login, password } and it should be { firstName, lastName }

const viewModel = { login: '[email protected]', password: 'jdoe3981' };
customerFormValidation
  .validateForm(viewModel)
  .then((validationResult) => {
    console.log(validationResult.success); // true
    console.log(validationResult.formGlobalErrors); // []
    console.log(validationResult.fieldErrors);
    /*{
        firstName: { succeeded: true, type: "REQUIRED", key: "firstName", errorMessage: "" },
        lastName: { succeeded: true, type: "REQUIRED", key: "lastName", errorMessage: "" }
      }*/
  })
  .catch((error) => {
    // handle unexpected errors
  });

manuumv avatar Jul 13 '19 13:07 manuumv