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.
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; .....
i have the following html im just wondering how will i go about selecting a product from the list then automatically on the change showing its unique cost in the cost text field.
Then depending on the quantity purchased of that product selection and what radio button is checked (cheque add 2$ total) (credit card increase total by 1.5 %) (cash add $5 to the total amount) and calculate the total amount of the product. Code:
I have a text field. I want the text field to change / be calculated on the action made on the dropdown menu... So if I select Debit card.. it should leave the amount as is..If I selected Credit Card it should add a percentage to the Amount.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>
I followed a tutorial online on how to use Javascript to calculate total price. Everything works fine, when all the dropdown select value has it's own value and does not correspond to each other.
Eg : Cake Type : Round $4.00 Cake Color : Red $3.00 Cake Filling : Raspberry $4.00 So total is $11.00
The problem comes when you want to add Cake Layers and the price of Cake Color changes based on No of Layers - 1 Layer , 2 Layer and so on. E.g.: Cake Layer : Layer 1 $5.00 | Layer 2 $2.50 | Layer 3 $2.50 (for color Orange) Cake Layer : Layer 1 $7.00 | Layer 2 $4.00 | Layer 3 $4.00 (for color Red)
Do I have to use if and else conditional statement for every possibility? I am just a beginner. Attached below is the example code I have so far: var filling_prices= new Array(); filling_prices["None"]=0; filling_prices["Lemon"]=5; filling_prices["Custard"]=5; filling_prices["Fudge"]=7; filling_prices["Mocha"]=8; filling_prices["Raspberry"]=10; ..... function getFillingPrice(){
Is there a better way of simplifying this calculation method? How do I change the price of form values based on selected values on previous dropdown.
As soon as a user types in an integer into one of the quantity boxes the total quantity gets updated. How exactly would i do this? I can make it update the total quantity after a user hit's a Validate button or any button, but i cant make it update in real time.
javascript coding portin of the web page.Need it to use the pop up alerts that have been input above and also to calculate the order upon entering a correct amount showing subtotal, tax, and total.
let me try to explain better what I'm trying to do. I'm a real newbie I don't know much javascript but I understand more or less the logic behind it... tell me if this solution should work and if you know how to do it please show me. [URL]... I need to make div#photo's width to match the total width measurement of all the images it contains. If you load the page and you don't touch the size, it will work fine... but that's not realistic. If I resize the page, which will happen often on this kind of page (I'm assuming), the whole thing goes haywire (try it, scroll to the last image and resize the page you'll see what I mean). What can I do? Is my idea the right solution? Am I not explaining this clearly enough? Let me know please, I'm desperate. I've been trying to get CSS to do this for me for 3 hours now. Nothing works.
I intend to start learning JS over the Xmas holidays, but right now I only have a very basic knowledge of it.I was just wondering if someone could point me in the right direction on how to do this, as I think i should be pretty easy.After someone changes something in the admin area [e.g. the position of an item] I want to be able to have a small div display at the top of the screen saying something like "Position Updated!" and then have it fade away after 2-3 seconds.
I am using this script which allows people to add links to a page and stores them in a cookie. I am redesigning the site and need to limit the amount of links which display to 5 or less. and/or restrict the amount of future entries to 5. Code:
I'm using the .html() function to update information in a div whenever a button is clicked, like this:
$("#myPic").click(function() { $("#myDiv").html("//new content for div goes here
However, for some of these new sections, the html is QUITE lengthy. can i store it on a separate file in the same directory and somehow import it?? Is there a better way?
I am trying to make a page that could display an unlimited amount of images. I mean that I want to be able to change the amount of pictures as I want. But in the same time I want the gallery to look like a table without making a table in my html.
I have a Javascript that calculates and displays how long, in minutes and seconds a user has been in online(Google Gears development) mode on a given web page. I need however, to modify the script so that it calculates and displays how long the user has been online on the web site. For e.g. on page 1 for 2 minutes 12 seconds. Moves to page 2 - total time on page 1 and 2= 4 minutes 13 seconds. My script (see below) starts a second counter then converts that to minutes and seconds. I have tried passing the secVar0 variable in the url but that comes back "undefined".
I have a Javascript that calculates and displays how long, in minutes and seconds a user has been in online(Google Gears development) mode on a given web page. I need however, to modify the script so that it calculates and displays how long the user has been online on the web site. For e.g. on page 1 for 2 minutes 12 seconds. Moves to page 2 - total time on page 1 and 2= 4 minutes 13 seconds. My script (see below) starts a second counter then converts that to minutes and seconds. I have tried passing the secVar0 variable in the url but that comes back "undefined".
I have 9 select menus that are populated by a php for loop. Each has a numeric value that is displayed base on the selection (which I have working).I can not figure out how to sum all of these values and display them in a <div> tag.what I have thus far:
// Part of a function that creates drop down boxes <select name="$name" onchange="document.getElementById('cost_$name').firstChild.nodeValue = this.options[this.selectedIndex].getAttribute('cost_$name')">
I am using frames - yes frames - I do not know how to do anything but and I know that there is better out there......but........ I am trying to set a frame so that it automatically puts a page corresponding to the month in that frame (a calendar) Code:
I am trying to create a monthly mortgage calculator, I have been able to make it show prompts for Amount of loan; Interest rate; and Term of loan (in months), but it will not display the results. Below is the code I have utilized to get this far.
I am looking for a push in the right direction for a few problems i am running into; my first problem is I have to create a script element that contains the function amountTotal which should return the sum of all the values in the amount array. There are no parameters for this function, and I have to add the following commands to it.
1. declare a variable named total with an initial value of 0
2. create a for loop thatloops through all of the values in the amount array, at each iteration of the loop, add the current value of the array item to the value of the total variable.
3. and after the for loop is completed, return the value of the total variable.
The amount array has already been created and populated in a list.js file, I had to first create a script element pointing to it.
This is what i had for my link to the list.js file and funtion :
I have my entire code written but i am trying to break it up and fix my problems 1 at a time: when i open the code, it does'nt display correctly ( which is another problem) but I ran the debugger and it says my total is undefined. ( this is in another section of my code), but I guess my function is wrong somewhere.
I'm trying to create a mortgage payment calculator in Javascript and am having problems. My algorithm seems correct but it's not giving the right results. Im using this code:
function do_calc_payment(){var term = document.calc_payment.term.value;var rate = document.calc_payment.rate.value;var amount = document.calc_payment.amount.value;var j = rate / (12*100);var m = term * 12;var payment = amount * ( j / (1 - (1 + j) ^ -m))var result = "$"+Math.round((payment)*1000)/1000;if(isNaN(payment)){document.calc_payment.rate.value="";document.calc_payment.amount.value="";result="Not a Number";}if(payment.length>=15){result="Max Characters";}document.getElementById('new_payment').innerHTML = result;}
I am having some difficulty in constructing a window.confirm() function that works with my code.So if the form data is valid, I need to use a window.confirm() dialog box to show the user's total cost based on the rental rate of equipment chosen and the reservation period. The user must accept the cost by pressing the confirm button, and if user cancels do not submit data.I have written this code but cannot figure out how to find the number of days from the 2 date fields and use that to calculate and display the total cost.
//confirm submit and display rental cost var equip = document.forms[0].equipment.value var pDate = document.forms[0].pickupDate.value[code].....