added va;idation for contact person. it will accept only alphabetical character
This commit is contained in:
parent
ef2fdf899c
commit
8f8ee765f7
@ -28,7 +28,10 @@ const ManageProjectInfo = ({ project, handleSubmitForm, onClose }) => {
|
||||
name: z.string().min(1, { message: "Project Name is required" }),
|
||||
contactPerson: z
|
||||
.string()
|
||||
.min(1, { message: "Contact Person Name is required" }),
|
||||
.min( 1, {message: "Contact Person Name is required"} )
|
||||
.regex(/^[A-Za-z\s]+$/, {
|
||||
message: "Contact Person must contain only letters",
|
||||
}),
|
||||
projectAddress: z
|
||||
.string()
|
||||
.min(1, { message: "Address is required" })
|
||||
@ -155,6 +158,7 @@ const ManageProjectInfo = ({ project, handleSubmitForm, onClose }) => {
|
||||
name="contactPerson"
|
||||
className="form-control"
|
||||
placeholder="Contact Person"
|
||||
maxLength={50}
|
||||
{...register("contactPerson")}
|
||||
/>
|
||||
{errors.contactPerson && (
|
||||
|
Loading…
x
Reference in New Issue
Block a user