1

Can anyone explain why i can not use oninput inside a table and how i can get it to work?

For example this works:

<form onsubmit="return false" oninput="o.value = parseInt(a.value) + parseInt(b.value)">
  <input name="a" type="number" step="any"> +
  <input name="b" type="number" step="any"> =
  <output name="o"></output>
</form>

And this does not:

<table>
<form onsubmit="return false" oninput="o.value = parseInt(a.value) + parseInt(b.value)">
  <input name="a" type="number" step="any"> +
  <input name="b" type="number" step="any"> =
  <output name="o"></output>
</form>
</table>
witipedia
  • 25
  • 3

1 Answers1

0
<form onsubmit="return false" oninput="o.value = parseInt(a.value) + parseInt(b.value)">
<table>

  <input name="a" type="number" step="any"> +
 <input name="b" type="number" step="any"> =
  <output name="o"></output>

</table>
</form>
Ankit Deshpande
  • 3,476
  • 1
  • 29
  • 42
  • It has nothing to do with those missing tags, but your answer lead me to the real cause. You started the form outside the table, then it works, when you start it after it doesn't!
    – witipedia Feb 08 '16 at 09:35