remove double space while registration
This commit is contained in:
@@ -169,7 +169,9 @@ export default function RegisterForm() {
|
|||||||
async function onChangeHandler(e: ChangeEvent<HTMLInputElement>): Promise<void> {
|
async function onChangeHandler(e: ChangeEvent<HTMLInputElement>): Promise<void> {
|
||||||
const fieldName = e.target.name;
|
const fieldName = e.target.name;
|
||||||
if (fieldName !== 'phone') {
|
if (fieldName !== 'phone') {
|
||||||
e.target.value = e.target.value.replace(/([^a-zA-Zа-яёА-ЯЁ0-9@.!#$%&"'*+/=?^_{|}~\-\s])/g, '');
|
e.target.value = e.target.value
|
||||||
|
.replace(/([^a-zA-Zа-яёА-ЯЁ0-9@.!#$%&"'*+/=?^_{|}~\-\s])/g, '')
|
||||||
|
.replace(/\s+/g, ' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fieldName === 'inn') {
|
if (fieldName === 'inn') {
|
||||||
|
|||||||
@@ -328,6 +328,8 @@
|
|||||||
"field-filled-automatically": "The field is filled in automatically",
|
"field-filled-automatically": "The field is filled in automatically",
|
||||||
"inn-invalid": "Invalid INN",
|
"inn-invalid": "Invalid INN",
|
||||||
"inn-placeholder": "Enter 10 digits",
|
"inn-placeholder": "Enter 10 digits",
|
||||||
"INN": "INN"
|
"INN": "INN",
|
||||||
|
"fullName-required": "Please fill in the field correctly.",
|
||||||
|
"fullName-too-short" : "Name must be at least 2 characters long."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -328,6 +328,8 @@
|
|||||||
"field-filled-automatically": "Поле заполняется автоматически",
|
"field-filled-automatically": "Поле заполняется автоматически",
|
||||||
"inn-invalid": "Неверный ИНН",
|
"inn-invalid": "Неверный ИНН",
|
||||||
"inn-placeholder": "Введите 10 цифр",
|
"inn-placeholder": "Введите 10 цифр",
|
||||||
"INN": "ИНН"
|
"INN": "ИНН",
|
||||||
|
"fullName-required": "Заполните поле корректно.",
|
||||||
|
"fullName-too-short" : "Имя должно содержать не менее 2 символов."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user