Commit 1fe14090 by Zen-PC\Zen

Zen : update validate

parent 7d868639
......@@ -66,7 +66,7 @@ use Cake\I18n\Time;
<?php echo __('firstname');?>
<em>* </em>
<?php echo $this->Form->input('UserPersonals.firstname_th', [
'class' => 'form-control-reg border-bottom-from label-text-sub required',
'class' => 'form-control-reg border-bottom-from label-text-sub required letterthai',
'value' => $responseUserPersonal['firstname_th'],
'id' => 'firstname_th',
'type' => 'text', 'label' => false,
......@@ -81,7 +81,7 @@ use Cake\I18n\Time;
<?php echo __('lastname');?>
<em>* </em>
<?php echo $this->Form->input('UserPersonals.lastname_th', [
'class' => 'form-control-reg border-bottom-from label-text-sub required',
'class' => 'form-control-reg border-bottom-from label-text-sub required letterthai',
'value' => $responseUserPersonal['lastname_th'],
'id' => 'lastname_th',
'type' => 'text', 'label' => false,
......@@ -174,7 +174,7 @@ use Cake\I18n\Time;
<?php echo __('email');?>
<em>* </em>
<?php echo $this->Form->input('UserPersonals.email', [
'class' => 'form-control-reg border-bottom-from label-text-sub required email',
'class' => 'form-control-reg border-bottom-from label-text-sub required email emailtext',
'value' => $responseUserPersonal['email'],
'id' => 'email',
'name' => 'email',
......
......@@ -27,14 +27,11 @@
| ------------------------------------------------------------------------------------------------------------------
*/
jQuery.validator.addMethod("emailtext", function (value, element) {
return this.optional(element) || /^([a-zA-Z@_.])+$/.test(value);
return this.optional(element) || /^([a-zA-Z0-9@_.])+$/.test(value);
}, "โปรดระบุที่อยู่อีเมล์ที่ถูกต้อง.");
jQuery.validator.addMethod("letterthai", function (value, element) {
return this.optional(element) || /^([a-zA-Zก-๙])+$/.test(value);
}, "เฉพาะตัวอักษรเท่านั้น.");
jQuery.validator.addMethod("letterthai", function (value, element) {
return this.optional(element) || /^([a-zA-Zก-๙])+$/.test(value);
}, "เฉพาะตัวอักษรเท่านั้น.");
jQuery.validator.addMethod("letters", function (value, element) {
return this.optional(element) || /^[a-zA-Z]+$/i.test(value);
}, "เฉพาะตัวอักษรเท่านั้น.");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment