Hello,
I have a table called "users" with a column "deactivated" (integer managed with a checkbox) and a column "date_deactivation" (date): I would like to check that the operator can't save a record checking "deactivated" without fill the "date_deactivation".
Can solve using hooks ?
ALex.
Check "checkbox" status.
Re: Check "checkbox" status.
Hi ALex
You can try this...(file : hooks/users-dv.js)
Hope this works.
You can try this...(file : hooks/users-dv.js)
Code: Select all
// pop up modal alert when checkbox checked without date
$j('#deactivated').on('change', function () {
var dateVal = $j('#date_deactivation').val();
var activeSts = $j(this).prop('checked');
if (activeSts && !dateVal) {
modal_window({
message: '<div class="alert alert-danger">' + 'Please enter a date first' + '</div>',
title: 'Error !',
close: function () {
$j("#deactivated").prop("checked", false);
$j("#date_deactivation").focus();
$j("#date_deactivation").parents('.form-group').addClass('has-error');
},
});
}
});
Zala.
Appgini 24.10.1579, MacOS 14.3.1 Windows 11 on Parallels.
Appgini 24.10.1579, MacOS 14.3.1 Windows 11 on Parallels.
Re: Check "checkbox" status.
Thank you zibrahim, great !
I will test immediately you JS and I’ll tell you.
ALex.
I will test immediately you JS and I’ll tell you.
ALex.