customer details
This commit is contained in:
parent
d4a0c7acf4
commit
7de081f142
@ -31,7 +31,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="csname" class="col-form-label">Last Name<span class="text-danger"> *</span></label>
|
<label for="csname" class="col-form-label">Last Name<span class="text-danger"> *</span></label>
|
||||||
<input type="text" class="form-control" name="csname" value="<?= isset($customer['last_name']) ? $customer['last_name'] : '' ?>" placeholder="Last Name" required />
|
<input type="text" class="form-control" name="csname" value="<?= isset($customer['last_name']) ? $customer['last_name'] : '' ?>" placeholder="Last Name" />
|
||||||
<div class="invalid-feedback"> Please provide. </div>
|
<div class="invalid-feedback"> Please provide. </div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
@ -42,12 +42,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="cmobile" class="col-form-label">Mobile<span class="text-danger"> *</span></label>
|
<label for="cmobile" class="col-form-label">Mobile/Landline<span class="text-danger"> *</span></label>
|
||||||
<div class="input-group mb-2">
|
<div class="input-group mb-2">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<div class="input-group-text">+91</div>
|
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" id="cmobile" name="cmobile" value="<?= isset($customer['mobile_no']) ? $customer['mobile_no'] : '' ?>" placeholder="Mobile Number (Enter only numbers)" required maxlength="10" onkeypress="return restriction(event)" onchange="checkExisting(this.value,'mobile_no','cmobile')" />
|
<input type="text" class="form-control" id="cmobile" name="cmobile" value="<?= isset($customer['mobile_no']) ? $customer['mobile_no'] : '' ?>" placeholder="Mobile Number (Enter only numbers)" required minlength="10" onkeypress="return restriction(event)" onchange="checkExisting(this.value,'mobile_no','cmobile')" />
|
||||||
<div class="invalid-feedback"> Please provide. </div>
|
<div class="invalid-feedback"> Please provide. </div>
|
||||||
</div>
|
</div>
|
||||||
<span id="mobileValidationMessage"></span>
|
<span id="mobileValidationMessage"></span>
|
||||||
@ -598,13 +598,24 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
function restriction(event) {
|
function restriction(event) {
|
||||||
var charCode = event.which || event.keyCode;
|
var charCode = event.which || event.keyCode;
|
||||||
if ((charCode >= 48 && charCode <= 57)) {
|
|
||||||
|
// Allow numeric values and backspace
|
||||||
|
if ((charCode >= 48 && charCode <= 57) || charCode === 8) {
|
||||||
|
var currentLength = document.getElementById('cmobile').value.length;
|
||||||
|
|
||||||
|
// Check if the length is within the desired range (10 to 15)
|
||||||
|
if (currentLength < 15 || charCode === 8) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
event.preventDefault(); // Prevent the character from being entered
|
event.preventDefault(); // Prevent input when the maximum length is reached
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
event.preventDefault(); // Prevent the character from being entered
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user