Adding from element that automatically calculates the value.

I want to create a “form” in which the element takes data from another user input element and display the calculated values below. The first value is given by the user and the second is a constant value and they should be multiplied and displayed.

The form should work like this: When a user enters a certain numerical value it automatically multiplies it to 0.05 and displays the result in another field below, in real time…
How do I do it?

Any advise would be highly appreciated.

You can add an onChange event handler to the input element that calculates and then sets the value of the second element.

It would look something like this:

export function input1_change(event) {
	$w("#text2").text =  String(parseInt($w("#input1").value) * 0.05);
}