Hi,
I have the following code on my page, it is taking Value A and Value B and simply applying a calculation of (AB)/100 and then ((AB)/100)+A
The page is showing the correct results, but on the two user inputed values are being writting to the database after clicking a submit button.
The two calculated fields are not written tto the database? Here is the code on the page:
export function input1_keyPress(event) {
var A = Number($w(‘#input1’).value + event.key);
var B = Number($w(‘#input2’).value);
var C = Number((A * B) / 100);
var D = Number((C + A));
$w('#input3').value = Number(C);
$w('#input4').value = Number(D);
}
export function input2_keyPress(event) {
var A = Number($w(‘#input1’).value);
var B = Number($w(‘#input2’).value + event.key);
var C = Number((A * B) / 100);
var D = Number((C + A));
$w('#input3').value = Number(C);
$w('#input4').value = Number(D);
}
Do i need to add a hook on the backend to do the calculation to write it to the database?