I have a javascript calculator that calculates payments. users type their balance owed into a form, and then click on a "calculate" button which calls in the function below, and interest rate paymetn is calculated and shown in another textbox on the form.
the problem i'm having is this: Instead of showing the calculation in a textbox, i would like to show it as normal text on the page, not in a box.
i tried doing document.write, but that shows only the total, and all other info on the page dissapears.
Is there another way of doing this?
here's my code:
<script language='Javascript'>
function calcPayment(form)
{
var cardName = form.cardName.value;
var balance = form.balance.value;
balance = stripCharacter(balance,',');
balance = stripCharacter(balance,' ');
var rt = balance*0.03;
rt = rt * 100;
rt = Math.round(rt);
strPennies = new String (rt);
len = strPennies.length;
rt = strPennies.substring(0, len - 2) + "." + strPennies.substring(len - 2, len);
form.MinMonthlyPaymnt.value = rt;
}
</script>
the problem i'm having is this: Instead of showing the calculation in a textbox, i would like to show it as normal text on the page, not in a box.
i tried doing document.write, but that shows only the total, and all other info on the page dissapears.
Is there another way of doing this?
here's my code:
<script language='Javascript'>
function calcPayment(form)
{
var cardName = form.cardName.value;
var balance = form.balance.value;
balance = stripCharacter(balance,',');
balance = stripCharacter(balance,' ');
var rt = balance*0.03;
rt = rt * 100;
rt = Math.round(rt);
strPennies = new String (rt);
len = strPennies.length;
rt = strPennies.substring(0, len - 2) + "." + strPennies.substring(len - 2, len);
form.MinMonthlyPaymnt.value = rt;
}
</script>