Merge pull request #83 from kjannette/minLength

more
This commit is contained in:
S Jannette
2024-02-03 16:48:37 -06:00
committed by GitHub
2 changed files with 5 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
export const signupFields = {
firstName: { required: true, label: "First Name", maxLength: 45 },
lastName: { required: true, label: "Last Name", maxLength: 45 },
firm: { required: true, label: "Firm", minLength: 2, maxLength: 45 },
firm: { required: true, label: "Firm", minLength: 3, maxLength: 45 },
telephone: {
required: true,
label: "Telephone: (###) ###-####",
@@ -11,7 +11,7 @@ export const signupFields = {
streetAddress: {
required: true,
label: "Street Address",
minLength: 2,
minLength: 3,
maxLength: 45,
},
city: { required: true, label: "City", maxLength: 45 },
@@ -42,12 +42,14 @@ export const signupFields = {
required: true,
label: "Password",
maxLength: 45,
minLength: 8,
type: "password",
},
confirmPassword: {
required: true,
label: "Confirm Password",
maxLength: 45,
minLength: 8,
compareTo: "password",
type: "confirmPassword",
},

View File

@@ -33,7 +33,7 @@ export const getValidatedFormData = (data, fields) =>
((!field.required && value === "") || value.length < field.minLength)
) {
error = true;
message = `This field require at least ${field.minLength} symbols`;
message = `Must be at least ${field.minLength} characters`;
}
if (
!error &&