diff --git a/src/app/ui/forms/register-form.tsx b/src/app/ui/forms/register-form.tsx index ff1f4a7..5ba7026 100644 --- a/src/app/ui/forms/register-form.tsx +++ b/src/app/ui/forms/register-form.tsx @@ -169,7 +169,9 @@ export default function RegisterForm() { async function onChangeHandler(e: ChangeEvent): Promise { const fieldName = e.target.name; 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') { diff --git a/src/i18n/messages/en.json b/src/i18n/messages/en.json index 25095f8..f5daf05 100644 --- a/src/i18n/messages/en.json +++ b/src/i18n/messages/en.json @@ -328,6 +328,8 @@ "field-filled-automatically": "The field is filled in automatically", "inn-invalid": "Invalid INN", "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." } } \ No newline at end of file diff --git a/src/i18n/messages/ru.json b/src/i18n/messages/ru.json index 21ab3e1..786a747 100644 --- a/src/i18n/messages/ru.json +++ b/src/i18n/messages/ru.json @@ -328,6 +328,8 @@ "field-filled-automatically": "Поле заполняется автоматически", "inn-invalid": "Неверный ИНН", "inn-placeholder": "Введите 10 цифр", - "INN": "ИНН" + "INN": "ИНН", + "fullName-required": "Заполните поле корректно.", + "fullName-too-short" : "Имя должно содержать не менее 2 символов." } } \ No newline at end of file