Page 1 of 3
Save the time of pressing the button on the form.
Posted: Thu Feb 04, 2021 10:17 pm
by kknm
Calling onclick on button 3 procedures:
1.nuRunPhpHide ('CCC'); - makes calculations and writes data to the database table.
2. nuGetBreadcrumb (); -to update the main form.
3. GetCurrentime () function for setting the time on the main form element.
I observe during PHP execution how point 3 worked and the time on the element appeared, but after point 2 it disappears.
Of course, you can save this value in my database, but I hope that nuBuilder has a callable function to save the entire form on event.
Re: Save the time of pressing the button on the form.
Posted: Fri Feb 05, 2021 3:45 am
by kev1n
HI,
Are you using nuJavascriptCallback? This is used to runs code after nuRunPHPHidden() has returned from the server.
https://wiki.nubuilder.cloud/ ... nPHPHidden
Re: Save the time of pressing the button on the form.
Posted: Fri Feb 05, 2021 7:48 am
by kknm
I think nuJavascriptCallback won't help in this situation because I need to update the form to read data from the database. I need to save a form with the currentTime received before a PHP function. I need to programmatically click on the 'Save' button.
Re: Save the time of pressing the button on the form.
Posted: Fri Feb 05, 2021 8:02 am
by kev1n
If nuRunPhpHidden ('CCC') write data to the DB, can't you write the current time as well?
Or maybe I just don't understand exactly what you want to do.
Re: Save the time of pressing the button on the form.
Posted: Fri Feb 05, 2021 8:21 am
by kknm
kev1n wrote:If nuRunPhpHidden ('CCC') write data to the DB, can't you write the current time as well?
Or maybe I just don't understand exactly what you want to do.
Quite lengthy nuRunPhpHidden ('CCC') writes many rows to its table and subform - there will be many unnecessary currentTime values, but I only want to record the time when the button was clicked in a separate element of the main form.
Re: Save the time of pressing the button on the form.
Posted: Fri Feb 05, 2021 8:30 am
by kev1n
Call another procedure with nuRunPHPHidden() that sets the timestamp?
Re: Save the time of pressing the button on the form.
Posted: Fri Feb 05, 2021 9:00 am
by kknm
kev1n wrote:Call another procedure with nuRunPHPHidden() that sets the timestamp?
It all comes down to nuGetBreadcrumb () -
I pressed the button - I got the time.
Called PHP and nuGetBreadcrumb () zeroes it out.
I need to programmatically save the main form before calling PHP.
Or update only the subform without updating the main one.
Re: Save the time of pressing the button on the form.
Posted: Fri Feb 05, 2021 9:04 am
by kev1n
kknm wrote:kev1n wrote:
I need to programmatically save the main form
Re: Save the time of pressing the button on the form.
Posted: Fri Feb 05, 2021 9:16 am
by kknm
kev1n wrote:kknm wrote:kev1n wrote:
I need to programmatically save the main form
NuSaveAction does not work for me on onclick event
Re: Save the time of pressing the button on the form.
Posted: Fri Feb 05, 2021 9:23 am
by kev1n
nuSaveAction(); will save the current record. It is also called when you click the (red) Save Button.
What do you mean "it doesn't work"?