Complaint via Paper Form
Send your Grievance to
The Commissioner,
Greater Chennai
@@ -292,7 +296,7 @@
-

+
Check Your Complaint Status
@@ -332,6 +336,12 @@
+
+
+
+
+
+
@@ -405,8 +415,7 @@
-
-
+
@@ -428,7 +437,7 @@
$('#check-now-btn').click(function () {
var complaintNumber = $('#complaint-number').val();
if (complaintNumber) {
- window.location.href = 'checklistofficer?complaintno=' + encodeURIComponent(complaintNumber);
+ window.location.href = '/pgr/checklistofficer?complaintno=' + encodeURIComponent(complaintNumber);
} else {
alert('Please enter a complaint number.');
}
@@ -461,7 +470,39 @@
}
}
+ // ✅ Mobile number validation as user types
+ $('#complaint-mobile').on('input', function () {
+ let value = this.value;
+
+ // Allow only digits
+ value = value.replace(/[^0-9]/g, '');
+
+ // Prevent starting with 0
+ if (value.startsWith('0')) {
+ value = '';
+ //showSnackbar("Mobile number cannot start with 0.");
+ }
+
+ // Limit to 10 digits
+ if (value.length > 10) {
+ value = value.slice(0, 10);
+ }
+
+ this.value = value;
+
+ // Check for all repeating digits
+ if (/^(\d)\1{9}$/.test(value)) {
+ $(this).addClass('is-invalid');
+ showSnackbar("Mobile number cannot be all repeating digits.");
+ } else {
+ $(this).removeClass('is-invalid');
+ }
+ });
+
$(document).ready(function () {
+
+
+
// Trigger modal and load complaint list based on mobile number
$('#check-mobile-btn').on('click', function () {
const mobileNumber = $('#complaint-mobile').val(); // Get the entered mobile number
@@ -470,10 +511,16 @@
alert("Please enter a mobile number.");
return;
}
+
+ if (mobileNumber.length !== 10 || !/^\d{10}$/.test(mobileNumber) || mobileNumber.startsWith('0') || /^(\d)\1{9}$/.test(mobileNumber)) {
+ alert("Enter a valid 10-digit mobile number.");
+ return;
+ }
+
$('#loader').show();
// AJAX request to fetch complaint details by mobile number
$.ajax({
- url: '/api/getComplaintDetailsByMobile', // Replace with your correct API path
+ url: '/pgr/api/getComplaintDetailsByMobile',
method: 'GET',
data: {mobileNo: mobileNumber},
success: function (response) {
@@ -490,7 +537,7 @@
complaintList.forEach(function (complaint) {
const complaintId = complaint.complaintid || 'N/A'; // Fallback to N/A if complaintid is null
const complaintType = complaint.complainttype || 'N/A';
-
+
const newRow = `
| ${complaintId} |
@@ -528,7 +575,7 @@
var complaintId = $(this).data('complaintid');
if (complaintId) {
// Redirect to the complaint details page using complaintId
- window.location.href = 'checklistofficer?complaintno=' + encodeURIComponent(complaintId);
+ window.location.href = '/pgr/checklistofficer?complaintno=' + encodeURIComponent(complaintId);
} else {
alert('Complaint ID not found.');
}
@@ -538,6 +585,7 @@
});
+