Add contact details field controller for length
This commit is contained in:
parent
e3ee53bcd5
commit
6ae2a44629
4 changed files with 17 additions and 0 deletions
|
|
@ -207,6 +207,20 @@ class ContactDetailsScreen extends React.Component {
|
|||
}) + '.\n',
|
||||
);
|
||||
}
|
||||
if (
|
||||
input?.value?.length &&
|
||||
input?.value?.length > 255 &&
|
||||
(formToValidate.type === InputType.EMAIL ||
|
||||
formToValidate.type === InputType.PHONE ||
|
||||
formToValidate.type === InputType.TEXT)
|
||||
) {
|
||||
console.debug('invalid data ', input.formSlug);
|
||||
error = error.concat(
|
||||
i18n.t('contact_details_s.input_too_long', {
|
||||
placeholder: formToValidate.placeholder[i18n.locale],
|
||||
}) + '.\n',
|
||||
);
|
||||
}
|
||||
if (
|
||||
input?.value?.length &&
|
||||
formToValidate.type === InputType.EMAIL &&
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@
|
|||
"contact_list": "Kontaktliste",
|
||||
"documents_list": "Liste der Dokumente",
|
||||
"input_required": "Das Feld %{placeholder} ist erforderlich",
|
||||
"input_too_long": "Das Feld %{placeholder} ist zu lang",
|
||||
"input_email": "Das Feld %{placeholder} muss eine gültige E-Mail-Adresse sein"
|
||||
},
|
||||
"contact_details_s": {
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@
|
|||
"input_select_please_choose": "Select a value",
|
||||
"input_select_multiple_search": "Search",
|
||||
"input_required": "The %{placeholder} field is required",
|
||||
"input_too_long": "%{placeholder} field is too long",
|
||||
"input_email": "The %{placeholder} field must be a valid email"
|
||||
},
|
||||
"error": {
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@
|
|||
"input_select_please_choose": "Selectionnez un élément",
|
||||
"input_select_multiple_search": "Recherche",
|
||||
"input_required": "Le champ %{placeholder} est obligatoire",
|
||||
"input_too_long": "Le champ %{placeholder} est trop long",
|
||||
"input_email": "Le champ %{placeholder} doit être un email valide"
|
||||
},
|
||||
"error": {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue