fix: enhance validation rules for agency and employer name fields
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 6s

This commit is contained in:
puriphatt 2025-05-23 11:40:22 +07:00
parent de281ea79f
commit 0916ce7af2
2 changed files with 25 additions and 6 deletions

View file

@ -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>