feat(userAccount): add validation for Iranian national code and update input handling
This commit is contained in:
@@ -42,14 +42,14 @@ function Form({ insurance, errors, changeData, information }) {
|
||||
<Field
|
||||
req={true}
|
||||
error={errors?.national_code}
|
||||
type="number"
|
||||
type="text"
|
||||
iconGray={true}
|
||||
name="national_code"
|
||||
isTransparent={true}
|
||||
changeData={changeData}
|
||||
data={information?.national_code}
|
||||
// کد ملی فقط وقتی از قبل مقدار دارد قفل میشود؛ اگر خالی است قابل افزودن باشد.
|
||||
disable={Boolean(information?.national_code)}
|
||||
changeData={(val, name) =>
|
||||
changeData(val.replace(/\D/g, "").slice(0, 10), name)
|
||||
}
|
||||
value={information?.national_code ?? ""}
|
||||
/>
|
||||
</Content>
|
||||
<Content req={true} error={errors?.name} title="نام" isConfirmed={false}>
|
||||
|
||||
Reference in New Issue
Block a user