fix: enhance validation rules for agency and employer name fields
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 6s
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 6s
This commit is contained in:
parent
de281ea79f
commit
0916ce7af2
2 changed files with 25 additions and 6 deletions
|
|
@ -68,7 +68,12 @@ type Options = { label: string; value: string };
|
|||
class="col-md-4 col-12"
|
||||
:label="$t('agencies.name')"
|
||||
v-model="name"
|
||||
:rules="[(val: string) => !!val || $t('form.error.required')]"
|
||||
:rules="[
|
||||
(val) => !!val || $t('form.error.required'),
|
||||
(val) =>
|
||||
/^[A-Za-z0-9ก-๙\s&.,'-]+$/.test(val) ||
|
||||
$t('form.error.branchNameField'),
|
||||
]"
|
||||
/>
|
||||
<q-input
|
||||
for="input-agencies-name-en"
|
||||
|
|
@ -79,6 +84,15 @@ type Options = { label: string; value: string };
|
|||
class="col-md-4 col-12"
|
||||
:label="'Agencies Name'"
|
||||
v-model="nameEn"
|
||||
:rules="
|
||||
nameEn
|
||||
? [
|
||||
(val) =>
|
||||
/^[A-Za-z0-9ก-๙\s&.,'-]+$/.test(val) ||
|
||||
$t('form.error.branchNameENField'),
|
||||
]
|
||||
: []
|
||||
"
|
||||
/>
|
||||
|
||||
<q-input
|
||||
|
|
|
|||
|
|
@ -137,7 +137,12 @@ watch(
|
|||
@update:model-value="
|
||||
(v) => (typeof v === 'string' ? (registerName = v.trim()) : '')
|
||||
"
|
||||
:rules="[(val: string) => !!val || $t('form.error.required')]"
|
||||
:rules="[
|
||||
(val) => !!val || $t('form.error.required'),
|
||||
(val) =>
|
||||
/^[A-Za-z0-9ก-๙\s&.,'-]+$/.test(val) ||
|
||||
$t('form.error.branchNameField'),
|
||||
]"
|
||||
/>
|
||||
|
||||
<q-input
|
||||
|
|
@ -153,10 +158,10 @@ watch(
|
|||
(v) => (typeof v === 'string' ? (registerNameEN = v.trim()) : '')
|
||||
"
|
||||
:rules="[
|
||||
(val: string) =>
|
||||
val === '' ||
|
||||
/^[0-9A-Za-z\s.,]+$/.test(val) ||
|
||||
$t('form.error.letterOnly'),
|
||||
(val) => !!val || $t('form.error.required'),
|
||||
(val) =>
|
||||
/^[A-Za-z0-9\s&.,'-]+$/.test(val) ||
|
||||
$t('form.error.branchNameENField'),
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue