The Crazy Chimp The Crazy Chimp - 1 year ago 91
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

to calculate the other values eg.

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

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

Answer Source

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

<form oninput="x.value=7+y.value;z.value=y.value+300">
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download