• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Mortgage Calculation Field

Mortgage Calculation Field 14 years 11 months ago #7567

I have a mortgage calculation where i have to enter in 3 fields with the following formula and i dont know how to script it in the additional attributs.

The following formula is used to calculate the fixed monthly payment (P) required to fully amortize a loan of L dollars over a term of n months at a monthly interest rate of c. [If the quoted rate is 6%, for example, c is .06/12 or .005].

P = L[c(1 + c)n]/[(1 + c)n - 1]

Heres what i tried but it didnt work if you could correct it i would highly appreciate it.

onclick="document.getElementById('total').value = parseInt(document.getElementById('Field1').value) * (parseInt(document.getElementById('Field2').value) *(1+ parseInt(document.getElementById('Field2').value))* parseInt(document.getElementById('Field3').value))/(1+ parseInt(document.getElementById('Field2').value))* parseInt(document.getElementById('Field3').value) -1);”
The administrator has disabled public write access.

Re:Mortgage Calculation Field 14 years 11 months ago #7579

  • bogdanc
  • bogdanc's Avatar
  • OFFLINE
  • Moderator
  • Posts: 669
  • Thank you received: 11
Hello,

You can try creating a script in the Form Layout. For example:
<script type="text/javascript">
function MortgageCalc()
{
document.getElementById('total').value = parseInt(document.getElementById('Field1').value) * 
(parseInt(document.getElementById('Field2').value) *(1+ parseInt(document.getElementById('Field2').value))* parseInt(document.getElementById('Field3').value))/
(1+ parseInt(document.getElementById('Field2').value))* 
parseInt(document.getElementById('Field3').value) -1);
}

And after that you can call the function in the onclick:
onclick="MortgageCalc()";

Hope this helps.

Regards!
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!