Dear Community Members,
Hope all of you are doing great!
As shown in the picture
I have a database called “Calculatedataset”.
I have created a form with 3 inputs. “input4” , “input5” , “input6”.
And, I have two buttons. “Calculate” and “Submit”.
In the “Calculatedataset” I have a field called “Total Number”. I have connected the “input4” to the database field “Totalnumber” and allowed to read-only.
When I click the button “Calculate”, the values in “input4” and “input5” are added together and the result can be seen in “input6”.
But, when I click the submit button, I want the value in the “input6” to be updated in the database field “Totalnumber” and to be shown when someone comes back.
This is the code I have used to calculate the fields.
console.log(“button has been pressed”)
$w(‘#input6’).value = Number($w(‘#input4’).value) + Number($w(‘#input5’).value);
console.log(“calculation finished”)
Please someone, help me to find a solution to update the database and save it in the database.
Thank You In Advance!
link : https://doctorantru.wixsite.com/testingwixcode/calculator