473,322 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Generate the formular from the script

Hi I am finding it hard to understand the script below

<SCRIPT language=JavaScript>
<!-- Begin
var i = 0; // interest
var m = 0; // months
var f = 0; // factor
var den = 0;
var s = "0"; // string
var d = 0; // decimal place
function CalcA() {
if(document.globalForm.interest.value=="" || document.globalForm.months.value=="" ||

document.globalForm.payment.value=="") {
alert("Please fill in all of the required fields.");
}
else {
if(document.globalForm.period.options[1].selected == true) {
m = document.globalForm.months.value * 12;
}
else {
m = document.globalForm.months.value;
}
i = Math.pow(((document.globalForm.interest.value/100)+1),.0833333)-1;
den = i / (i+1);
f = Math.pow((i+1),m)-1;
f /= den;
f *= document.globalForm.payment.value;
d = String(f).indexOf(".");
s = String(f).substring(0,(d+3));
document.globalForm.total.value = + s;
}
}
// End -->
</SCRIPT>

All i want is get the formular out which was applied in the above script so i can use coldfusion tags in solving the same problem. I don't want to use javascript for the caculation so if any one can deduce the formular from the scripts please do and inform me about it jamesonkeju@yahoo.com
Nov 29 '06 #1
1 1420
r035198x
13,262 8TB
Hi I am finding it hard to understand the script below

<SCRIPT language=JavaScript>
<!-- Begin
var i = 0; // interest
var m = 0; // months
var f = 0; // factor
var den = 0;
var s = "0"; // string
var d = 0; // decimal place
function CalcA() {
if(document.globalForm.interest.value=="" || document.globalForm.months.value=="" ||

document.globalForm.payment.value=="") {
alert("Please fill in all of the required fields.");
}
else {
if(document.globalForm.period.options[1].selected == true) {
m = document.globalForm.months.value * 12;
}
else {
m = document.globalForm.months.value;
}
i = Math.pow(((document.globalForm.interest.value/100)+1),.0833333)-1;
den = i / (i+1);
f = Math.pow((i+1),m)-1;
f /= den;
f *= document.globalForm.payment.value;
d = String(f).indexOf(".");
s = String(f).substring(0,(d+3));
document.globalForm.total.value = + s;
}
}
// End -->
</SCRIPT>

All i want is get the formular out which was applied in the above script so i can use coldfusion tags in solving the same problem. I don't want to use javascript for the caculation so if any one can deduce the formular from the scripts please do and inform me about it jamesonkeju@yahoo.com
Which part do you not understand?
Nov 29 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: k.mitz | last post by:
Hi, I have a PHP application that allows users to generate a .pdf report of their database content. Normally, I've had to refresh a page to call the script to generate the report, so there's a...
1
by: ete | last post by:
Hallo zusammen, ist es möglich, dass man in Access aus einem Formular heraus bestimmte Felder auswählen kann, die dann ausschließlich gedruckt werden können? Vielen Dank für die Hilfe
2
by: amir | last post by:
Hallo liebe Gemeinde, ich möchte aus einem Formular aus, eine bereits vorhandene Laufendenummer aus einer Tabelle.spalte auslese und dazu noch eine 1 addiere und dann das Ergebnis in ein...
1
by: Niko Mann | last post by:
Hallo zusammen, ich habe folgendes Problem: Ich habe ein Formular in dem ein Gesamtwert in einem Feld errechnet wird. Jetzt möchte ich diesen Gesamtwert automatisch in ein anderes Feld im...
0
by: Brunner | last post by:
Hi, I'd like to print a diagram which is embedded in a formular. The only possibility I found is to draw the diagram in print event handler by hand on a Graphics. However this seems to be very...
5
by: David Lozzi | last post by:
Hello, I'd like to create the SQL script for any given table, view or proc in my database, through ASP.Net using VB. I'm building a module library and providing this code on the fly would ease...
0
by: ward | last post by:
Greetings. Ok, I admit it, I bit off a bit more than I can chew. I need to complete this "Generate Report" page for my employer and I'm a little over my head. I could use some additional...
1
by: Chris Zopers | last post by:
Hello, I want to generate a SQL Script of a SQL Server database. To do this, I right-click the database name and choose the option All Tasks/Generate SQL Script. Than I get a text file with a...
23
by: Geoff Cox | last post by:
Hello, Is it possible to use php to generate different menus for users who have access to files in different folders? For example, user Fred might be able to access files in folders A, B and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.