title: How do i Multiply the Value of a readonly input field and display the result in another field
body: <p>I have Three input fields, When you input BTC amount in the first field, it gives you the BTC equivalent in USD. Then i added a hidden input field which holds a specific value, let's say &quot;460&quot;, Now i want the BTC equivalent in USD to Multiply the &quot;460&quot; and give the result in a readonly input field. Below the code demonstrating my explanation.</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>$(".form-control").keyup(function() { //input[name='calc']
    let convFrom;
    if ($(this).prop("name") == "btc") {
      convFrom = "btc";
      convTo = "usd";
    } else {
      convFrom = "usd";
      convTo = "btc";
    }
    $.getJSON("https://api.coindesk.com/v1/bpi/currentprice/usd.json",
      function(data) {
        var origAmount = parseFloat($("input[name='" + convFrom + "']").val());
        var exchangeRate = parseInt(data.bpi.USD.rate_float);
        let amount;
        if (convFrom == "btc")
          amount = parseFloat(origAmount * exchangeRate);
        else
          amount = parseFloat(origAmount / exchangeRate);
        $("input[name='" + convTo + "']").val(amount.toFixed(2));
      });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://stacksnippets.net/scripts/snippet-javascript-console.min.js?v=1"&gt;&lt;/script&gt;
  &lt;script src="https://code.jquery.com/jquery-3.5.1.min.js"&gt;&lt;/script&gt;
  &lt;form&gt;
    &lt;input type="number" name="btc" class="form-control" id="validationTooltip02" placeholder="BTC"&gt;
    &lt;input type="number" name="usd" class="form-control" id="a" onkeyup="add()" placeholder="USD" readonly&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>The for the multiplication, i added onkeyup function to the USD field,</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot;&gt;
          function add() {
    var x = parseInt(document.getElementById(&quot;a&quot;).value);
    var y = parseInt(document.getElementById(&quot;b&quot;).value)
    document.getElementById(&quot;c&quot;).value = x * y;
  }
      &lt;/script&gt;
  </code></pre>
  <p>then tried to collect the result by ID into a field using <code>&lt;input name=&quot;amount&quot; class=&quot;form-control&quot; type=&quot;text&quot; placeholder=&quot;0.00000&quot; id=&quot;c&quot; aria-label=&quot;0.00000&quot; readonly&gt;</code></p>
  <p>This works if i remove readonly in the USD field and type directly but does not work with the result of the BTC to USD sum in the field when it's readonly. I hope i was able to explain this. Please help as i am not an expert.</p>