Work out the difference between two values and displaying result in a textbox
Im trying to work out the difference between two values in a textbox and display the result on a label or textbox as soon as the second number is entered.
This is what i tried so far. This is in the <script> element
- $('#BeginSN').on(function () {
- var diff = Number($("#EndSN").text()) - Number($("#BeginSN").text());
- $('#Form-amount').val(diff);
- });
This is my control
- <label>Number of Forms to be allocated:</label>
- <input id="Form-amount" type="number" />
So the user will enter a Begin Serial Number then a End Serial Number. As soon as the end serial number is entered i want to display the difference on a label or textbox on the page. Thanks in advance for the help.