Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Code/event for calculation/refresh directly after key pressing

Avatar

Level 1

Hi all,

does anybody know how one can let a text field

make a calculation based on the input of other

number field after a single number is pressed by the keyboard.

(to refresh itself each time the user inputs anything

in the number field). I have 10 number fields for input and a

text field that sums the input of these 10 number fields.

And now i dont know how (what event or code) to make

the number field with dynamic input (after a key/number is

pressed, the text field should automatically refresh /sum/ itself).

But not by input and then click, but by key press directly ...

I am using Adobe Designer 8.0 (with FormCalc and java script).

I would appreciate any help, cause i didnt find anything on the topic

till now.

Greetings

2 Replies

Avatar

Level 10

Hi,

It's a bit clunky, but you can achieve this with script in the change event of each of the 10 numeric fields. Each time a user inputs a digit it recalculates the total based on the new value of the field.

There is no script in the totalSum field.

Good luck,

Niall

Avatar

Level 1

Hello,

that was exactly what i needed.

It works perfect!

THANK YOU VERY MUCH!!!

Greetings,

Momchil