In addition to correct answer by Zoltán Zörgő:
First bug I can see immediately:
document.getElementById("txt_remainingfees")=v.value;
What is
v.value
?! Should be:
document.getElementById("txt_remainingfees").value=v;
Besides, to get values from strings, you had to use
parseInt(string)
:
http://www.w3schools.com/jsref/jsref_parseint.asp[
^].
I would also advise to use jQuery. It would be:
total=parseInt($("#txt_totalfees"));
fees = parseInt($("#txt_payFees"));
result = $("#txt_remainingfees");
result.value = total.value - fees.value;
Please see:
http://en.wikipedia.org/wiki/JQuery[
^],
http://jquery.com/[
^].
—SA