title: JS and onchange event in html form
body: <p>My code error is pretty obvious but I can´t see it.
  <br>
  It's very simple my form ask the <code>height</code> and <code>weight</code> and <strong>calculate</strong> the <code>corporal mass index</code> the user input height in meters and convert to inches (function works ok) 
  <br>
  input kilos and convert to pounds (works ok too) but in this process must calculate the index and write it in another textbox. that's my problem!
  <br>
  What am I doing wrong??? heres my code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>      function myFunctionmts() {
          var x = document.getElementById("mters");
          var y = document.getElementById("inches");
          y.value = ((x.value*100)/2.54).toFixed(2);
          document.getElementById("mters").value=x.value;
          document.getElementById("inches").value=y.value;
        }
       &lt;/script&gt;
       &lt;script&gt;
        function myFunctionkg() {
          var i = document.getElementById("imc");
          var p = document.getElementById("inches");
          var x = document.getElementById("kilos");
          var z = document.getElementById("pounds");
          var step1 = 0;
          var step2 = 0;
          var step3 = 0;
          z.value = (x.value/.454).toFixed(2);
          libras.value=z.value;
          document.getElementById("pounds").value=z.value;
          step1.value = z.value*703;
          step2.value = step1.value/p.value;
          step3.value = (step2.value/p.value).toFixed(1);
          document.getElementById("imc").value=step3.value
        }
       </code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form method="POST" action="#"&gt; 
       &lt;input type="text" name="mters" id="mters" required onchange="myFunctionmts()"&gt;
       &lt;input type="text" name="inches" id="inches" placeholder="Inches" readonly&gt;
       &lt;input type="text" name="kilos" id="kilos" required onchange="myFunctionkg()"&gt;
       &lt;input type="text" name="pounds" id="pounds" placeholder="Pounds" readonly&gt;
       &lt;input type="text" name="imc" id="imc" readonly&gt;
       &lt;input type="submit" value="Save"&gt;
      &lt;/form&gt;
       </code></pre>
  </div>
  </div>
  </p>