Bank Website - Calculating Loan Repayment With Interest

Jun 10, 2010

I am having a few problems with my JS, and now that the module has finished, I find myself struggling still. I am going to post my JS and the HTML page its related to. The site is a mock up for an assignment - basically, its a pretend bank website where a person applies for a loan, and all my JS does is work out if the applicant does the following correctly:

Enters repayment years 1 to 25
Enters a loan amount of 1000 to 250000
Checks a box for loan protection
Calculate button
Reset Button
Then tells the user what it is going to cost them from interest to total amount to be paid.

Javascript:
function init(){
var baserate=4.25;
var amount=parseInt(document.getElementById("loan").value);// end bracket missing - done
var repaymentyears=parseInt(document.getElementById("repaymentyrs").value);// end bracket missing - done
var rate;
var interest;
var loanprotect=5;
var total;
var monthlyrepayment=repaymentyears*12; .....

View 4 Replies


ADVERTISEMENT

Display The Total Loan Repayment Amount Instead Of The Monthly Payment

Oct 3, 2011

i want the code below to display the total loan repayment amount instead of the monthly payment payment = principle * monthly interest/(1 - (1/(1+MonthlyInterest)*Months)) , eg if if l0an is 20$ payment is in 4 months, intrest rate is 15% display = amount to be repaid.

[Code]....

View 3 Replies View Related

Date Time Picker That Can Disable Weekends And Bank Holidays

Jun 29, 2010

does anyone know of a timepicker that i can disable weekends and bank holidays (or that at least easily has a place i can add code to disable days by making a call to my database of holidays in ajax?)

View 2 Replies View Related

Calculate Interest Earned Code?

Feb 8, 2011

I'm a JavaScript newbie and need help with code.Given principle, yearly interest rate and time in years, I need to calculate interest earned and the ending amount in the account at the end of time.

Formulas:

I=P*R*T
S=P+T

This is what I have which didn't work:

<script type="text/javascript">
var P,R,T,I,S;
P=prompt("enter your Principle","");

[code]...

View 5 Replies View Related

Getting A Program That Will Compare Loans With Various Interest Rates?

Nov 15, 2011

monthly payment = c*r*(1+r)^n /(1+r)^n

View 22 Replies View Related

Changing Calculation In Simple Interest Calculator

Aug 10, 2010

The exercise problem is to "MODIFY the code in the "calculate_click" event so interest is added to future value just once each year for the number of years that they were entered by the user". The calculation as you see it below assumes an amount is invested MONTHLY (not just once), and the interest is calculated accordingly. This is what I think the problem is trying to calculate: using a $100 one time investment at 10% interest (compounded once annually) for one year = $110 as the future value. For two years, the future value should equal $121 (110 + (110*.10)). Okay, if my math is wrong, let me know. This is what I'm trying to get it to match to.

I have been able to modify the calculate_click function to compound the interest annually (it does it monthly now). Cool. I cannot get it to stop adding $100 annually. See my math above? I think that's the answer. My manipulation of the code yields $110 for the first year, $231 for the second year, etc. The $231 is incorrect cuz it adds an extra $100. See, this is a simple interest calculator I can't figure out! The original code is below that calculates the investment as a monthly investment as opposed to one-time. To avoid confusion, I did not include any of my modifications. But yeah. I know that the major culprit is how the "for" loop is being executed. I've highlighted where I think the code needs to be changed, but I haven't changed it here. Note the first function is a shortcut to execute getElementbyID.

The Code:
var $ = function (id) {
return document.getElementById(id);
} var calculate_click = function () {
var investment = parseFloat( $("investment").value );
var annualRate = parseFloat( $("rate").value );
var years = parseInt( $("years").value );
$("futureValue").value = ""; .....

View 2 Replies View Related

Mortgage Calc Adding Extra Decimal Place To Interest Rate

Oct 12, 2009

I have a mortgage calc that is adding an extra decimal place to my interest rate. To see this in action go to: [URL]
Change the interest rate to 7.5
Click Calculate Payment
Click Create Amortization Chart
On the following screen you'll see a recap of your data and the interest rate will now say 7.55. Same thing happens if you enter 6.2. Next screen shows 6.22/. I've attached the html and js files in a zip.

View 2 Replies View Related

Files In Website Are Constantly Getting Injected With Malicious Codes Which Redirects Website?

Jan 28, 2010

The javascripts files in my website are constantly getting injected with malicious codes which redirects my website

View 2 Replies View Related

Code A Feature For Website Using DHTML Where The Person Viewing The Website?

Dec 29, 2005

I'm trying to code a feature for my website using DHTML where the person viewing the website can rotate between viewing the positive/negative points of the website being reviewed. This example was in the publication called Using HTML 4 by Lee Anne Phillips. Code:

View 5 Replies View Related

JQuery :: Ajax Program On Website A Call Website B?

Nov 30, 2010

I have a ajax program on a page on website A. And I need to let it talk to a program on website B. I tried to put website B into the url of the parameter but it doesn't work.It gives me a "[objet XMLHttpRequest]" error.here is the code on website A:

[Code]...

View 1 Replies View Related

Adding Up, Calculating Value?

Mar 1, 2010

i have a table, with 2 numeric values at the minute, if the checkbox is selected I want the total price to be shown? this is the form I have with the numeric values

<form id="calculation" action="#" method="post">
100 <input type="checkbox" name="check1" value="100" onClick='total_cost()'/>
120 <input type="checkbox" name="check2" value="200" onClick='total_cost()'/>[code].....

View 5 Replies View Related

Calculating A Person's Age?

Dec 1, 2010

I am trying to write a script that will take a date of birth and another date and, if the person was over 75 years old on the createdDate, return "true" (otherwise return "false").

Unfortunately my code doesn't seem to return either 'true' or 'false'!

The code is:

var dateofBirth="30/10/1982";
var createdDate="01/12/2010";
var sd = dateofBirth.split('/');
var dob = new Date(sd[2],sd[1],sd[0]);

[Code]....

View 2 Replies View Related

Allow A User Of A Website To Add A Poll To The Website

Apr 27, 2010

Suppose I want to allow a user of a website to add a poll to the website for everyone to see/vote on. How exactly would I write a script for that?

View 8 Replies View Related

Putting Part Of Another Website On Another Website?

Nov 17, 2009

I have a webpage and i want to put a section of another website on to my own website..

The Section i want to put on my website is on this page www.bebo.com/thegaadiscos and i only want to put the section with the comments on it...

What i want is a bit like the face book section of this website [URL]

View 4 Replies View Related

Calculating Client IP Address

Jul 23, 2005

I want to create a link that a user can click which will create a popup
telling the user their ip address. I have:

var ip = new java.net.InetAddress.getLocalHost().toString();
alert("Your IP address is: " + ip.substring(ip.indexOf("/")+1))

but this does not seem to work. It says the ip is 127.0.0.1. Strangely,
this piece of code used to work but all of a sudden it doesn't for some
unknown reason. Can anyone tell me what's wrong with the above code?

View 3 Replies View Related

Calculating Difference Between Two Dates Using JS

Nov 10, 2006

I have two date fields (check in, check out) and "number of days"
field.

I want the script to calculate automatically the difference.
For example: I have defaults dates, and I want the script to put the
difference in "number of days" field. And if the user will change the
date, the number of days will change automatically.

View 1 Replies View Related

Calculating Age From Date Of Birth?

Jul 11, 2009

I am using date of birth field in my application and i m taking date of birth in yyyy-mm-dd format.

I need to calculate age by using this date of birth and should show alert if age is less than 5 years.

View 2 Replies View Related

Calculating Shipping With If/else And Function?

Sep 21, 2009

I am having difficulty getting the following assignment to run properly:Many companies charge a shipping and handling charge for purchases. Create a Web page that allows a user to enter a purchase price into a text box and includes a JavaScript function that calculates shipping and handling. Add functionality to the script that adds a minimum shipping and handling charge of $1.50 for any purchase that is less than or equal to $25.00.For any orders over $25.00, add 10% to the total purchase price for shipping and handling,but do not include the $1.50 minmum shipping and handling charge. The formula for calculating a percentage is price * percent / 100. For example, the formula for calculating 10% of a $50.00 purchase price is 50 * 10 / 100, which results in a shipping and handling charge of $5.00. After you determine the total cost of the order (purchase plus shipping and handling), display it in an alert dialog box. Save the document as CalcShipping.html.This is what I have after working on it round and round for 4 hours yesterday:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">[code].....

View 5 Replies View Related

Auto Calculating Form

Mar 22, 2007

I've been googleing for a auto calculating form and found nothing, I just want something .. some form, that can add values from different fields ... and make a sum .. in real time ... meaning that ... if I put X value in field #1 and Y value in field #2, at the bottom or somewhere I should have the X+Y value :P..

View 4 Replies View Related

Calculating Textbox Value For Html?

Mar 6, 2010

calculating textbox value from java script for html

Example: (textbox1value X textbox2value) + (textbox3value + textbox4value)= result

where result value should display in textbox5

View 1 Replies View Related

Calculating Difference Between The Two Numbers?

Jul 2, 2009

the following javascript is not calculating the difference between the two numbers.cant understand y

<script language="JavaScript" type="text/javascript">
function showAmt(){
total = document.total.value;[cod

View 2 Replies View Related

Calculating The Average/mean In An Array ?

Mar 30, 2011

Im trying to calculate the mean/average of numbers in an array.how can i get the length of an array to perform in a simple / maths problem whilst being flexiable to the length of the array?

function sum()
{
var i=0 [code].....

View 2 Replies View Related

Calculating Percentage In A Form?

Mar 23, 2010

I am writing a form and doing a bunch of calculations one of which is a percentage based on the value selected. I am returning a correct result for two of the values but for the other two I am not.The 'discount' value is what I am looking for. It should return as 0 for values of 1 but it is doing the math as though it is multiplying by 1. And again for the value of 6 it should be 10% but is taking the value as 4.6 or something.Code is below I've included all of it (sorry) for better ease of understanding the math that is happening:

HTML Code:

<form id="form1" action="" method="get">
<fieldset>
<p>[code]......

View 3 Replies View Related

Calculating Possible Routes Between Two Points

Oct 18, 2011

I am not a developer so not so familiar with javascript. Suppose I have a map with ten junctions and based on that map. I need to calculate all the possible routes between one junction to another. How do I represent the map in javascript and how do I code the function to calculate all the possible routes?

View 1 Replies View Related

Calculating Amount Of Time?

Nov 15, 2011

I was wondering if it is possible to figure out the amount of time passed from a specific time in history till the present? If so how? I have tried so many different things and I am not getting the right returns.

View 3 Replies View Related

Calculating The Scroll Area?

Jun 19, 2009

I am writing a DHTML application which uses AJAX to show dialogue windows etc.. (all the bells and whistles).When I display a DHTML dialogue in the foreground, I use JS to create a div which is a "layer" in between the foreground and the background which essentially "darkens" the background and disables all background functionality. Forcing the user to take action in the dialogue.How do I get the total scrollable area of the page so I know how big to make the "dark" div?I have tried all of these:

document.body.scrollWidth
document.body.scrollHeight
document.body.offsetWidth

[code]...

They all work in one browser or another, (I am testing in IE, FF and Opera) but none of them give me the correct values for the exact scrollable area of the page.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved