Compare commits
2 Commits
48a9d760df
...
7cc8cb8179
| Author | SHA1 | Date |
|---|---|---|
|
|
7cc8cb8179 | |
|
|
deca6819fe |
|
|
@ -337,8 +337,7 @@ if (!empty($submissions->data->submissions)) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('label[for="field-record_date"]').html('Date <span class="text-danger">*</span><br><small class="text-danger">Future date is not allowed.</small>');
|
|
||||||
|
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
var today = new Date();
|
var today = new Date();
|
||||||
|
|
|
||||||
|
|
@ -294,6 +294,37 @@
|
||||||
$('#field-contact_id').trigger('change');
|
$('#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