witipedia February 2016

Using HTML5 forms with oninput inside a table

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>

Answers


Ankit Deshpande February 2016

<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>

Post Status

Asked in February 2016
Viewed 2,069 times
Voted 9
Answered 1 times

Search




Leave an answer