473,320 Members | 1,961 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,320 software developers and data experts.

Savings Calculator

1
Hi everyone!

I am rather stuck trying to create a very simple savings calculator on a website. All I need to have is a field for number of PC's, Printers, Servers and how much is spent per month on IT.

When they click the "get Quote" button, I'm hoping to show them how much I can save them!! This is what I have so far, if anyone can help, that would be so great!

[HTML]<script type="text/javascript">
function MyCalc(){
var val1 = document.frmqut.textPc.value;
var amt1 = 190 * parseFloat(val1);
var val2 = document.frmqut.textPrinter.value;
var amt2 = 50 * parseFloat(val2);
var val3 = document.frmqut.textServers.value;
var amt3 = 900 * parseFloat(val3);
var val4 = document.frmqut.textCost.value;
var amt4 = parseFloat(val4);

var amt = amt4 - (amt1 + amt2 + amt3);
alert("Your monthly total to support these PC's will be £" + amt);
}
</script>
<font color="#666666">Please Enter Number of PC's</font><br>
<input type="text" name="textPc">
<br>
<font color="#666666">Please Enter Number of Printers</font><br>
<input type="text" name="textPrinter">
<br>
<font color="#666666">Please Enter Number of Servers</font><br>
<input type="text" name="textServers">
<br>
<font color="#666666">Please Enter Monthly IT Cost</font><br>
<input type="text" name="textCost">
<br>
<input type="button" name="btnCalc" value="Get the Quote" onclick="MyCalc()">
</p>[/HTML]

Someone kindly helped me by sending me this very basic script.

TIA
Hi2Shy
Mar 15 '08 #1
1 1174
acoder
16,027 Expert Mod 8TB
You just need to wrap the form elements within form tags named "frmqut".
Mar 17 '08 #2

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

Similar topics

3
by: Bathroom_Monkey | last post by:
For posterity's sake, here is an algorithm I created to take a GMT time and convert it to U.S. central time, accounting for daylight saving time. Note: this algorithm can be modified to work for...
24
by: firstcustomer | last post by:
Hi, Firstly, I know NOTHING about Javascript I'm afraid, so I'm hoping that someone will be able to point me to a ready-made solution to my problem! A friend of mine (honest!) is wanting to...
4
by: Polaris431 | last post by:
I have a web application in ASP.NET that will be used globally. Data is collected on mobile devices running Windows Mobile and sent to the web server where it is stored and can be viewed. Data is...
3
by: mandy335 | last post by:
public class Calculator { private long input = 0; // current input private long result = 0; // last input/result private String lastOperator = ""; // keeps track of...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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)...
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.