customer details

This commit is contained in:
heama 2024-03-02 13:35:52 +05:30
parent d4a0c7acf4
commit 7de081f142

View File

@ -31,7 +31,7 @@
</div>
<div class="form-group col-md-4">
<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>
<div class="form-group col-md-4">
@ -42,12 +42,12 @@
</div>
<div class="form-row">
<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-prepend">
<div class="input-group-text">+91</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>
<span id="mobileValidationMessage"></span>
@ -598,13 +598,24 @@
}
</script>
<script>
function restriction(event) {
var charCode = event.which || event.keyCode;
if ((charCode >= 48 && charCode <= 57)) {
function restriction(event) {
var charCode = event.which || event.keyCode;
// 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;
} else {
event.preventDefault(); // Prevent the character from being entered
event.preventDefault(); // Prevent input when the maximum length is reached
return false;
}
} else {
event.preventDefault(); // Prevent the character from being entered
return false;
}
}
</script>