PHP variables to Javascipt
Posted: Tue Apr 30, 2024 7:12 pm
Good morning
I created a form that refers to a table (edit) with only two fields.
in this form in the BS function I execute a query on another table to retrieve another value, then I perform some calculations.
After saving the entered data, I would like the result of the previously performed calculation to be visible in a 'text area' of the same form..
in the BS function I try to use the following command:
nuSetNuDataValue($nudata, nuHash()['nuFORMdata'][0]->id, 'text', $mydata);
where $mydata is the php variable that contains the result of the calculation.
I then thought about creating a javascript function afterSave { } .
Is this the correct way or is there a better way?
If yes, what is the command to insert into the javascript function that allows to update a text form field?
Thanks in advance
I created a form that refers to a table (edit) with only two fields.
in this form in the BS function I execute a query on another table to retrieve another value, then I perform some calculations.
After saving the entered data, I would like the result of the previously performed calculation to be visible in a 'text area' of the same form..
in the BS function I try to use the following command:
nuSetNuDataValue($nudata, nuHash()['nuFORMdata'][0]->id, 'text', $mydata);
where $mydata is the php variable that contains the result of the calculation.
I then thought about creating a javascript function afterSave { } .
Is this the correct way or is there a better way?
If yes, what is the command to insert into the javascript function that allows to update a text form field?
Thanks in advance