The Crazy Chimp The Crazy Chimp - 20 days ago 6
HTML Question

How to run multiple calculations using `oninput` (HTML5)?

I need a way of running a few calculations based on the contents of a single text box. I'm currently using a form, with the text box what accepts numeric values. I then use the

oninput
to calculate the other values eg.

<form oninput="x.value=7+y.value">


However I need a way of running multiple calculations using
oninput
. Is this possible? If so how? If not, what are my other options?

Answer

I solved this issue. You can do something like so:

<form oninput="x.value=7+y.value;z.value=y.value+300">