I have a very strange behavior in my code.
If I add nuBeforeSave (even empty) it my page does not save
If I remove nuBeforeSave it does safe but sn_datetime is just 0000-00-00 00:00:00 whereas if I use nuBeforeSave it fills the correct date (e.g 2018-01-22 14:32:36).
Maybe also worth mentioning is if I have the "0000-00-00 00:00:00" issue it actually shows me the correct date in the field for about half a second before changing back to "0000-00-00 00:00:00" and save it.
I am sure the are two diffent issues, however they seem to be linked in my case.
Code: Select all
function nuOnClone() {
$('#sn_sn').val('');
$('#sn_sn').focus();
}
function checkchange() {
if ($('#sn_sn').val().length != 10) {
alert('This is not a Serial Number');
$('#sn_sn').val('');
return;
}
now = new Date().toISOString().slice(0, 19).replace('T', ' ');
$('#sn_user').val(nuAccessLevelCode());
$('#sn_datetime').val(now);
nuSaveAction();
setTimeout(function(){ nuCloneAction(); }, 2000);
}
function nuBeforeSave(){
}
same layout as -> https://forums.nubuilder.cloud/viewtopic.php?f=19&t=9243
I just update unBuilder today from git hub.
thank you for your great help so far
BR
Moritz