Update field#2 when you change field#1, then Submit

Hi guys…

I have 2 fields.

amount
due

I want due = amount *0.015.

I will enter an amount (eg. $100)
Then press a "CALC Button
The ‘due’ field should update to $101.50
Then I press the SEND button to enter both values into my collection.

So,… HOW?

Hi guys… I have 2 fields. amount due
I want due = amount *0.015. The user will enter an amount (eg. $100) I press a "CALC Button The ‘due’ field should update to $101.50
Then I press the SEND button to enter both values into my collection.
So,… HOW?

Hi,
From what i understood, you need 2 things, an input textBox to enter the amount and a text to display the due, So your code should look something like this :


export function amount_change(event) {
let amount = $w("#amount").value;
 let due = amount * 0.015;
  $w("#due").text = due.toString();
   }

Hope this helps!
Best,

Mustafa

Hi Mustafa…

i GOT IT WORKING!

let amount = $w(“#amount”).value;
let due = amount * 1.015;
$w(“#due”).value = due.toString();
}

I had to change ‘text’ to ‘value’
Thank you for your help.