Hello.. Im a super noob to Java but learning fast.
I am tring to create a tool but I need to add an extra field to Increses the price depending on the number of paint coats desired.
In other words, an imput field that if the number 1 is entered it gives one price, #2 gives a different and #3 gives a 3rd price.
I created a script that displays all 3 results, but I rather have a field were you enter the number (1 2 or 3).
Im not sure what to try in order to acomplish this.
Anyone can help with this? -
<script>
-
function count(val) {
-
val = val.split(" ");
-
document.form.op4.value = val
-
update_cost(val);
-
update_cost_3(val);
-
update_cost_5(val);
-
}
-
function update_cost(val) {
-
var price = "";
-
if (val<=15999){ price = "Invalid"; }
-
if (val>=16000 && val<=19999){ price = "$1,380"; }
-
if (val>=20000 && val<=24999){ price = "$1,897"; }
-
if (val>=25000 && val<=29999){ price = "$2,415"; }
-
if (val>=30000 && val<=34999){ price = "$2,955"; }
-
if (val>=35000 && val<=39999){ price = "$3,507"; }
-
if (val>=40000 && val<=44999){ price = "$4,140"; }
-
if (val>=45000 && val<=49999){ price = "$4,657"; }
-
if (val>=50000 && val<=54999){ price = "$5,175"; }
-
if (val>=55000 && val<=59999){ price = "$5,692"; }
-
if (val>=60000 && val<=69999){ price = "$6,210"; }
-
if (val>=70000 && val<=79999){ price = "$6,727"; }
-
if (val>=80000){ price = "$7,245"; }
-
document.form.op4.value = price;
-
}
-
function update_cost_3(val) {
-
var price = "";
-
if (val<=15999){ price = "Invalid"; }
-
if (val>=16000 && val<=19999){ price = "$1,518"; }
-
if (val>=20000 && val<=24999){ price = "$2,087"; }
-
if (val>=25000 && val<=29999){ price = "$2,656"; }
-
if (val>=30000 && val<=34999){ price = "$3,251"; }
-
if (val>=35000 && val<=39999){ price = "$3,858"; }
-
if (val>=40000 && val<=44999){ price = "$4,554"; }
-
if (val>=45000 && val<=49999){ price = "$5,123"; }
-
if (val>=50000 && val<=54999){ price = "$5,692"; }
-
if (val>=55000 && val<=59999){ price = "$6,261"; }
-
if (val>=60000 && val<=69999){ price = "$6,831"; }
-
if (val>=70000 && val<=79999){ price = "$7,400"; }
-
if (val>=80000){ price = "$7,969"; }
-
document.form.op5.value = price;
-
}
-
function update_cost_5(val) {
-
var price = "";
-
if (val<=15999){ price = "Invalid"; }
-
if (val>=16000 && val<=19999){ price = "$1,656"; }
-
if (val>=20000 && val<=24999){ price = "$2,277"; }
-
if (val>=25000 && val<=29999){ price = "$2,898"; }
-
if (val>=30000 && val<=34999){ price = "$3,546"; }
-
if (val>=35000 && val<=39999){ price = "$4,209"; }
-
if (val>=40000 && val<=44999){ price = "$4,968"; }
-
if (val>=45000 && val<=49999){ price = "$5,589"; }
-
if (val>=50000 && val<=54999){ price = "$6,210"; }
-
if (val>=55000 && val<=59999){ price = "$6,831"; }
-
if (val>=60000 && val<=69999){ price = "$7,452"; }
-
if (val>=70000 && val<=79999){ price = "$8,073"; }
-
if (val>=80000){ price = "$8,694"; }
-
document.form.op6.value = price;
-
}
-
</script>
-
<form name="form"><br>
-
Unit amount:<br>
-
<textarea onkeyup="count(this.innerHTML)" name="op31"></textarea><br>
-
Single Coat:<br> <input value="0" name="op4" /> <br>
-
Double Coat:<br> <input value="0" name="op5" /> <br>
-
Triple Coat:<br> <input value="0" name="op6" /> <br>
-
</p>
-
</form>
-
0 1169 Sign in to post your reply or Sign up for a free account.
Similar topics
by: Shan |
last post by:
Is there any tool available for generating unit test code in .NET. This is
reverse engineering process, which we have to unit test methods in a class.
Tool such as Nunit can test the methods only...
|
by: Namratha Shah \(Nasha\) |
last post by:
Hi All,
We have almost covered all the .NET Framework Tools except a few, which we
will cover in the coming days.
Today we will are going to check out a tool called as mscorcfg.msc. This is
a...
|
by: news.microsoft.com |
last post by:
To Microsoft and fellow MSDN Universal subscribers...
Regarding new MSDN Universal (I mean Premier) price and level changes:
1) Way too expensive for the small and medium developer Universal...
|
by: Thelma Lubkin |
last post by:
I've been unable to find code for adding an option to an option group.
I did find this instruction on a site called softlookup.com:
"If you want to add another option button to an option group,...
|
by: Jennifer |
last post by:
I have a table that I am trying to do a query on.
Table is named GPFCount2.
CREATE TABLE (
NULL ,
NULL ,
NULL ,
NULL ,
NULL ,
|
by: Ark Khasin |
last post by:
Unit testing is an integral component of both "formal" and "agile"
models of development. Alas, it involves a significant amount of tedious
labor.
There are test automation tools out there but...
|
by: Himanshugupta |
last post by:
when we click the folder option in tool option from the menu bar, The foder option not open and when we change the volume name the volume name have automatically change next time we open the windows
|
by: mo.sparrow |
last post by:
Typemock Isolator – A powerful mocking framework for .NET unit
testing and Test Driven Development (in Visual Studio).
http://www.typemock.com/learn_about_typemock_isolator.html
NUnit - A...
|
by: tuxalot |
last post by:
I've copied the option group from my form, and pasted it into the report which seems to work fine. Now, I wish to total the option items in the report. So I have a query that grabs records within a...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |