Zenova Domain (Tracker form )- Date limit
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m43s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m43s
Details
This commit is contained in:
parent
deca6819fe
commit
7cc8cb8179
|
|
@ -294,6 +294,37 @@
|
|||
$('#field-contact_id').trigger('change');
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
var today = new Date();
|
||||
var maxDate = today.toLocaleDateString('en-CA'); // YYYY-MM-DD
|
||||
var minDate = '2026-10-01';
|
||||
|
||||
var $recordDate = $('#field-record_date');
|
||||
|
||||
|
||||
$recordDate.attr({
|
||||
min: minDate,
|
||||
max: maxDate
|
||||
});
|
||||
|
||||
// Date validation function
|
||||
function validateFutureDate() {
|
||||
var selectedDate = $recordDate.val();
|
||||
|
||||
if (selectedDate && selectedDate > maxDate) {
|
||||
alert('Future date is not allowed. Please select today or a past date.');
|
||||
$recordDate.val(''); // Clear the input field
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Android वर instant trigger होण्यासाठी input, change, आणि blur
|
||||
$recordDate.on('input change blur', function() {
|
||||
validateFutureDate();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue