This commit is contained in:
afiq
2021-01-28 11:56:54 +08:00
parent d7c3a528d1
commit c58c0dbc39
5 changed files with 392 additions and 315 deletions
+15 -6
View File
@@ -20,7 +20,7 @@
<div class="input-group my-3">
<input type="text" class="form-control" id="noic" name="noic" placeholder="No Kad Pengenalan Pelanggan" aria-label="No Kad Pengenalan Pelanggan" autocomplete="off" value="{{$search == false ? '' : $noic ?? ''}}" aria-describedby="button-addon2">
<div class="input-group-append">
<select class="form-select" id="customerIDType" name="customerIDType">
<select class="form-select" id="customerIDType" name="customerIDType" class="form-control">
<option value="nokp" {{ $idtype == 'nokp' ? 'selected' : ''}}>Kad Pengenalan</option>
<option value="passport" {{ $idtype == 'passport' ? 'selected' : ''}}>Passport</option>
</select>
@@ -526,7 +526,7 @@
event.preventDefault();
return false;
}else{
if(customerphone.length < 8 && customerphone.length > 12){
if(!(customerphone.length < 9 && customerphone.length >= 12)){
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -653,7 +653,7 @@
event.preventDefault();
return false;
}else{
if(customerphone.length < 8 && customerphone.length > 12){
if(customerphone.length <= 9 && customerphone.length >= 12){
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -674,7 +674,7 @@
}
}
if(customerphone_alternate != ''){
if(customerphone_alternate.length < 8 && customerphone_alternate.length > 12){
if(customerphone_alternate.length <= 8 && customerphone_alternate.length >= 12){
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -821,11 +821,11 @@
return leapYearCount;
}
var regex = /^[a-zA-Z0-9]+$/g;
function verifynokp(){
var id_type = $('#customerIDType').val();
var nokp = $('#noic').val();
if(id_type=='nokp'){
if($.isNumeric(nokp) == false){
Swal.fire({
@@ -864,6 +864,15 @@
event.preventDefault();
return false;
}
if(regex.test(nokp) == false){
Swal.fire({
icon: 'error',
title: 'Amaran!',
text: 'Sila Periksa Passport Pelanggan'
});
event.preventDefault();
return false;
}
}
}
</script>