Code: Select all
var chiuso = '14ff917726f5cc'; // status ID
var rstID = document.getElementById('rst_status_id').value;
if(rstID == chiuso) {
// Formatta la data odierna
var today = new Date();
var d = today.getDate();
var m = today.getMonth() + 1;
var y = today.getFullYear();
today = (d<=9?'0'+d:d)+'-'+(m<=9?'0'+m:m)+'-'+y;
document.getElementById('rst_ritired').value = today;
uDB('rst_ritired');
}
I display correctly the change on the form, but when I save the record the rst_ritired field in db is '0000-00-00'. Why??
I solved it by checking the two fields in PHP in the AfterSave form field, but I think this is not the right way.
Any suggestion?
Thanks.