I have two textbox as follow:
<input id="amount" name="amount" type="text" value="0" />
<input id="discount" name="discount" type="text" value="0" />
I want substract discount from amount, and add result to another textbox. How can I do it?
I have two textbox as follow:
<input id="amount" name="amount" type="text" value="0" />
<input id="discount" name="discount" type="text" value="0" />
I want substract discount from amount, and add result to another textbox. How can I do it?
You can do this using JavaScript/Jquery
Suppose your third textbox is
Then your Jquery code will be
var vResult = parseInt( $('#amount').val() ) - parseInt( $('#discount').val() );
$('#result').val( vResult );
$("#result").val(parseInt($("#amount").val(), 10) - parseInt($("#discount").val(), 10));
That should do it. jsFiddle here.