|
|
|
@ -3,29 +3,18 @@ |
|
|
|
<head> |
|
|
|
<meta charset="UTF-8"> |
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
|
|
<title>GCC - Birth & Death</title> |
|
|
|
<title>GCC - Birth And Death</title> |
|
|
|
|
|
|
|
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"> |
|
|
|
|
|
|
|
|
|
|
|
<!-- Include Bootstrap Icons CDN in <head> if not already --> |
|
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css"> |
|
|
|
<!-- jQuery (Only load it once) --> |
|
|
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> |
|
|
|
|
|
|
|
<!-- Popper.js (Required for Bootstrap 4) --> |
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script> |
|
|
|
|
|
|
|
<!-- Bootstrap JS --> |
|
|
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script> |
|
|
|
|
|
|
|
<!-- SweetAlert JS (optional if you plan to use it) --> |
|
|
|
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> |
|
|
|
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script> |
|
|
|
|
|
|
|
|
|
|
|
<!-- <link th:href="@{/styles/loginpage.css}" rel="stylesheet" /> --> |
|
|
|
<style> |
|
|
|
|
|
|
|
/* Header Styling */ |
|
|
|
.header { |
|
|
|
background-color: #134356; |
|
|
|
@ -173,6 +162,7 @@ |
|
|
|
width: 150px; /* optional: set fixed width */ |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
</style> |
|
|
|
</head> |
|
|
|
<body style="background-color: #ebf1fa;"> |
|
|
|
@ -269,7 +259,7 @@ |
|
|
|
<span class="text-danger">*</span> |
|
|
|
<input type="text" |
|
|
|
id="phoneNumber" class="form-control" |
|
|
|
placeholder="Enter Mobile number" |
|
|
|
placeholder="Enter Registered Mobile number" |
|
|
|
oninput="validatePhoneNumber(this)"> |
|
|
|
</div> |
|
|
|
|
|
|
|
@ -362,8 +352,24 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<!-- jQuery (Only load it once) --> |
|
|
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> |
|
|
|
|
|
|
|
<!-- Popper.js (Required for Bootstrap 4) --> |
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script> |
|
|
|
|
|
|
|
<!-- Bootstrap JS --> |
|
|
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script> |
|
|
|
|
|
|
|
<!-- SweetAlert JS (optional if you plan to use it) --> |
|
|
|
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> |
|
|
|
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script> |
|
|
|
|
|
|
|
<!-- <script th:src="@{/script/loginpage.js}"></script> --> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
|
|
|
|
|
|
|
document.addEventListener("DOMContentLoaded", function () { |
|
|
|
@ -429,38 +435,35 @@ $(document).ready(function () { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// phone number validation |
|
|
|
|
|
|
|
/* function validatePhoneNumber(input) { |
|
|
|
// Remove any non-numeric characters using regex |
|
|
|
input.value = input.value.replace(/[^0-9]/g, ''); |
|
|
|
|
|
|
|
// Limit the input to 10 digits |
|
|
|
if (input.value.length > 10) { |
|
|
|
input.value = input.value.slice(0, 10); |
|
|
|
} |
|
|
|
} */ |
|
|
|
|
|
|
|
|
|
|
|
function validatePhoneNumber(input) { |
|
|
|
// Remove non-numeric characters |
|
|
|
let value = input.value.replace(/[^0-9]/g, ''); |
|
|
|
|
|
|
|
// Prevent first digit from being 0 |
|
|
|
if (value.startsWith('0')) { |
|
|
|
value = value.substring(1); |
|
|
|
// Prevent input if first digit is 0 |
|
|
|
if (value.length === 1 && value[0] === '0') { |
|
|
|
value = ''; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Limit to 10 digits |
|
|
|
// Enforce Indian mobile format: starts with 6-9 and has exactly 10 digits |
|
|
|
if (value.length > 10) { |
|
|
|
value = value.slice(0, 10); |
|
|
|
} |
|
|
|
|
|
|
|
// Update input value |
|
|
|
input.value = value; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Optional: check for invalid numbers starting with digits other than 6-9 |
|
|
|
if (value.length === 10 && !/^[6-9]\d{9}$/.test(value)) { |
|
|
|
Swal.fire({ |
|
|
|
title: "Invalid Mobile Number", |
|
|
|
text: "Please enter a valid 10-digit Indian mobile number starting with 6-9.", |
|
|
|
icon: "error", |
|
|
|
confirmButtonText: "OK", |
|
|
|
allowOutsideClick: false |
|
|
|
}); |
|
|
|
input.value = ""; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$('#registersubmit').click(function (event) { |
|
|
|
@ -635,7 +638,7 @@ $(document).ready(function () { |
|
|
|
|
|
|
|
setTimeout(function () { |
|
|
|
Swal.close(); |
|
|
|
console.log("OTP sent response:", response); |
|
|
|
//console.log("OTP sent response:", response); |
|
|
|
|
|
|
|
$('#mobilenotxt').html(mobileNumber); |
|
|
|
$('#otpForm').modal({ |
|
|
|
@ -690,7 +693,7 @@ $(document).ready(function () { |
|
|
|
dataType: 'json', |
|
|
|
success: function (response) { |
|
|
|
|
|
|
|
console.log("response...",response); |
|
|
|
//console.log("response...",response); |
|
|
|
if (response.userName) { |
|
|
|
localStorage.setItem("userName", response.userName); |
|
|
|
} |
|
|
|
@ -701,7 +704,7 @@ $(document).ready(function () { |
|
|
|
Swal.close(); |
|
|
|
if (response.status === "Success") { |
|
|
|
//alert("inside line 890 " + response.userName); |
|
|
|
console.log("Welcome, " , response.userName); |
|
|
|
//console.log("Welcome, " , response.userName); |
|
|
|
Swal.fire({ |
|
|
|
title: "OTP Verified!", |
|
|
|
text: "Your OTP has been successfully verified.", |
|
|
|
@ -832,5 +835,6 @@ $(document).ready(function () { |
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
</body> |
|
|
|
</html> |