diff --git a/src/modules/01_exam/components/Form/Information.vue b/src/modules/01_exam/components/Form/Information.vue index 7b267b1..4e91286 100644 --- a/src/modules/01_exam/components/Form/Information.vue +++ b/src/modules/01_exam/components/Form/Information.vue @@ -153,6 +153,7 @@ :class="getClass(status == 'register' || status == 'rejectRegister')" :outlined="status == 'register' || status == 'rejectRegister'" dense + type="tel" counter lazy-rules :readonly="!(status == 'register' || status == 'rejectRegister')" @@ -161,7 +162,7 @@ maxlength="13" :rules="[ (val) => !!val || `${'กรุณากรอก เลขบัตรประจำตัวประชาชน'}`, - (val) => val.length >= 13 || `${'กรุณากรอกเลขบัตรประจำตัวประชาชนให้ครบ'}` + (val) => /^[0-9]*$/.test(val) || `${'กรุณากรอกเลขบัตรประจำตัวประชาชนให้ถูกต้อง'}` ]" label="เลขบัตรประจำตัวประชาชน" /> @@ -276,7 +277,7 @@ v-model="informaData.tel" :rules="[ (val) => !!val || `${'กรุณากรอก โทรศัพท์'}`, - (val) => val.length >= 9 || `${'กรุณากรอกข้อมูลโทรศัพท์ให้ครบ'}` + (val) => /^[0-9]*$/.test(val) || `${'กรุณากรอกข้อมูลโทรศัพท์ให้ถูกต้อง'}` ]" :label="`${'โทรศัพท์'}`" /> @@ -295,7 +296,7 @@ v-model="informaData.phone" :rules="[ (val) => !!val || `${'กรุณากรอก โทรศัพท์มือถือ'}`, - (val) => val.length >= 10 || `${'กรุณากรอกข้อมูลโทรศัพท์มือถือให้ครบ'}` + (val) => /^[0-9]*$/.test(val) || `${'กรุณากรอกข้อมูลโทรศัพท์มือถือให้ถูกต้อง'}` ]" :label="`${'โทรศัพท์มือถือ'}`" /> diff --git a/src/modules/01_exam/components/Form/Occupation.vue b/src/modules/01_exam/components/Form/Occupation.vue index 4f83cd7..c7b8fb6 100644 --- a/src/modules/01_exam/components/Form/Occupation.vue +++ b/src/modules/01_exam/components/Form/Occupation.vue @@ -232,13 +232,18 @@ hide-bottom-space :outlined="status == 'register' || status == 'rejectRegister'" dense + counter + maxlength="10" lazy-rules - type="textarea" + type="tel" autogrow :readonly="!(status == 'register' || status == 'rejectRegister')" :borderless="!(status == 'register' || status == 'rejectRegister')" v-model="occupationData.tel" - :rules="[(val) => !!val || `${'กรุณากรอก โทรศัพท์'}`]" + :rules="[ + (val) => !!val || `${'กรุณากรอก โทรศัพท์'}`, + (val) => /^[0-9]*$/.test(val) || 'กรุณากรอก โทรศัพท์ให้ถูกต้อง' + ]" :label="`${'โทรศัพท์'}`" />