This commit is contained in:
Kenneth Jannette
2024-02-03 16:47:36 -06:00
parent 82aae88d18
commit 771687a108
2 changed files with 5 additions and 3 deletions

View File

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

View File

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