Fill fields On Save
Posted: Thu May 15, 2014 11:36 am
Hi
Like described in this post http://forums.nubuilder.cloud/viewtopic.p ... 53a#p12634, I would like to update two existing databasefields with the current user and current date as soon as any form field is changed. I would like to do this when an existing record is modified and re-saved.
The methods for the new record work, but what would the onsave code be for a filed record?
I tried different Javascripts without success (because I am a newbie).
F.eks. for the date I have this code on the Javascript of the form:
And on the BeforeOpen Tab:
Max, could you advise more details for the OnSave code for current user and current date? Thank you.
Tinka
Like described in this post http://forums.nubuilder.cloud/viewtopic.p ... 53a#p12634, I would like to update two existing databasefields with the current user and current date as soon as any form field is changed. I would like to do this when an existing record is modified and re-saved.
The methods for the new record work, but what would the onsave code be for a filed record?
I tried different Javascripts without success (because I am a newbie).
F.eks. for the date I have this code on the Javascript of the form:
Code: Select all
//-- Change date is current date
{var today = new Date()
var dd = today.getDate()
var mm = currentDate.getMonth() + 1
var yyyy = currentDate.getFullYear()
var currentDate = mm+'-'+dd+'-'+yyyy};
{pri_chngdate.value = currentDate};
}
Code: Select all
pri_chngdate.value = currentDate;
Tinka