diff --git a/screens/render-form-field/index.tsx b/screens/render-form-field/index.tsx index dbecb6d..f5a9562 100644 --- a/screens/render-form-field/index.tsx +++ b/screens/render-form-field/index.tsx @@ -1,6 +1,6 @@ 'use client' -import { useRef, useState } from 'react' +import { ChangeEvent, useRef, useState } from 'react' import { FormFieldType } from '@/types' import { cn } from '@/lib/utils' @@ -122,6 +122,7 @@ export const renderFormField = (field: FormFieldType, form: any) => { const [smartDatetime, setSmartDatetime] = useState() const [countryName, setCountryName] = useState('') const [stateName, setStateName] = useState('') + const [password, setPassword] = useState('') const canvasRef = useRef(null) const dropZoneConfig = { @@ -557,7 +558,17 @@ export const renderFormField = (field: FormFieldType, form: any) => { {field.label} - + )=>{ + setPassword(e.target.value) + form.setValue(field.name, e.target.value, { + shouldValidate: true, + shouldDirty: true, + }) + }} + /> {field.description} @@ -568,7 +579,15 @@ export const renderFormField = (field: FormFieldType, form: any) => { {field.label} - + + { + form.setValue(field.name, phoneNumber, { + shouldValidate: true, + shouldDirty: true, + }) + }}/> {field.description}