diff --git a/app/Views/client_branch.php b/app/Views/client_branch.php index fd00a267..61f5ec37 100755 --- a/app/Views/client_branch.php +++ b/app/Views/client_branch.php @@ -172,7 +172,7 @@ input:checked + .slider-branch-contact:before {
@@ -180,7 +180,9 @@ input:checked + .slider-branch-contact:before { + data-parsley-pattern-message="Branch Code can contain letters, numbers, underscore (_) and hyphen (-)." + oninput="this.value = this.value.replace(/[^A-Za-z0-9_-]/g, '')" + onblur="this.value = this.value.trim();">
@@ -209,14 +211,14 @@ input:checked + .slider-branch-contact:before {
@@ -771,7 +773,7 @@ function appendContactHtml(contact = false, reset = false) {
@@ -1364,7 +1366,8 @@ function setDefaultUnitValue() { var client_id = $('#client_id_branch').val(); - var branch_code = $('#branch_code').val(); + var branch_code = ($('#branch_code').val() || '').trim(); + $('#branch_code').val(branch_code); var units = $('#selected').val(); console.log('client_id', client_id) diff --git a/app/Views/insurer_branch.php b/app/Views/insurer_branch.php index 6ea9b4ae..92494a03 100755 --- a/app/Views/insurer_branch.php +++ b/app/Views/insurer_branch.php @@ -108,15 +108,17 @@
+ data-parsley-pattern="^[a-zA-Z0-9\s_-]+$" + data-parsley-pattern-message="Branch Code can contain letters, numbers, spaces, underscore (_) and hyphen (-)." + oninput="this.value = this.value.replace(/[^A-Za-z0-9_\- ]/g, '')" + onblur="this.value = this.value.trim();">
@@ -147,7 +149,7 @@ @@ -158,7 +160,7 @@
@@ -197,8 +199,8 @@
+ data-parsley-pattern="^[a-zA-Z0-9\s_-]+$" + data-parsley-pattern-message="Contact name can contain letters, numbers, spaces, underscore (_) and hyphen (-).">
@@ -213,7 +215,7 @@
@@ -456,7 +458,7 @@ if (!/^[a-zA-Z0-9\s_-]+$/.test(v)) return 'Branch Name can contain letters, numbers, spaces, underscore (_) and hyphen (-).'; return ''; case 'branch_code': - if (!/^[a-zA-Z0-9_-]+$/.test(v)) return 'Branch Code can contain letters, numbers, underscore (_) and hyphen (-).'; + if (!/^[a-zA-Z0-9\s_-]+$/.test(v)) return 'Branch Code can contain letters, numbers, spaces, underscore (_) and hyphen (-).'; return ''; case 'address1': return ''; @@ -968,8 +970,8 @@
+ data-parsley-pattern="^[a-zA-Z0-9\s_-]+$" + data-parsley-pattern-message="Contact name can contain letters, numbers, spaces, underscore (_) and hyphen (-).">
@@ -984,7 +986,7 @@
diff --git a/app/Views/layout/footer.php b/app/Views/layout/footer.php index 3851bb0e..9463619c 100755 --- a/app/Views/layout/footer.php +++ b/app/Views/layout/footer.php @@ -277,6 +277,7 @@