Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Save the time of pressing the button on the form.

Questions related to customising nuBuilder Forte with JavaScript or PHP.
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Save the time of pressing the button on the form.

Unread post 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.
kev1n
nuBuilder Team
Posts: 4305
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Save the time of pressing the button on the form.

Unread post 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
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Re: Save the time of pressing the button on the form.

Unread post by kknm »

kev1n wrote:HI,

Are you using nuJavascriptCallback? This is used to runs code after nuRunPHPHidden() has returned from the server.

https://wiki.nubuilder.cloud/ ... nPHPHidden
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.
kev1n
nuBuilder Team
Posts: 4305
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Save the time of pressing the button on the form.

Unread post 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.
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Re: Save the time of pressing the button on the form.

Unread post 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.
kev1n
nuBuilder Team
Posts: 4305
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Save the time of pressing the button on the form.

Unread post by kev1n »

Call another procedure with nuRunPHPHidden() that sets the timestamp?
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Re: Save the time of pressing the button on the form.

Unread post 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.
kev1n
nuBuilder Team
Posts: 4305
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Save the time of pressing the button on the form.

Unread post by kev1n »

kknm wrote:
kev1n wrote: I need to programmatically save the main form

Code: Select all

nuSaveAction()
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Re: Save the time of pressing the button on the form.

Unread post by kknm »

kev1n wrote:
kknm wrote:
kev1n wrote: I need to programmatically save the main form

Code: Select all

nuSaveAction()
NuSaveAction does not work for me on onclick event
kev1n
nuBuilder Team
Posts: 4305
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Save the time of pressing the button on the form.

Unread post 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"?
Post Reply