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

Unit count + option pricing tool

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?

Expand|Select|Wrap|Line Numbers
  1. <script> 
  2. function count(val) { 
  3. val = val.split(" "); 
  4. document.form.op4.value = val 
  5. update_cost(val);
  6. update_cost_3(val);
  7. update_cost_5(val);
  8. function update_cost(val) { 
  9. var price = ""; 
  10. if (val<=15999){ price = "Invalid"; } 
  11. if (val>=16000 && val<=19999){ price = "$1,380"; } 
  12. if (val>=20000 && val<=24999){ price = "$1,897"; } 
  13. if (val>=25000 && val<=29999){ price = "$2,415"; } 
  14. if (val>=30000 && val<=34999){ price = "$2,955"; } 
  15. if (val>=35000 && val<=39999){ price = "$3,507"; } 
  16. if (val>=40000 && val<=44999){ price = "$4,140"; } 
  17. if (val>=45000 && val<=49999){ price = "$4,657"; } 
  18. if (val>=50000 && val<=54999){ price = "$5,175"; } 
  19. if (val>=55000 && val<=59999){ price = "$5,692"; } 
  20. if (val>=60000 && val<=69999){ price = "$6,210"; } 
  21. if (val>=70000 && val<=79999){ price = "$6,727"; } 
  22. if (val>=80000){ price = "$7,245"; } 
  23. document.form.op4.value = price; 
  24. }
  25. function update_cost_3(val) { 
  26. var price = "";
  27. if (val<=15999){ price = "Invalid"; } 
  28. if (val>=16000 && val<=19999){ price = "$1,518"; }
  29. if (val>=20000 && val<=24999){ price = "$2,087"; }
  30. if (val>=25000 && val<=29999){ price = "$2,656"; }
  31. if (val>=30000 && val<=34999){ price = "$3,251"; }
  32. if (val>=35000 && val<=39999){ price = "$3,858"; }
  33. if (val>=40000 && val<=44999){ price = "$4,554"; }
  34. if (val>=45000 && val<=49999){ price = "$5,123"; }
  35. if (val>=50000 && val<=54999){ price = "$5,692"; }
  36. if (val>=55000 && val<=59999){ price = "$6,261"; }
  37. if (val>=60000 && val<=69999){ price = "$6,831"; }
  38. if (val>=70000 && val<=79999){ price = "$7,400"; }
  39. if (val>=80000){ price = "$7,969"; }
  40. document.form.op5.value = price; 
  41. }
  42. function update_cost_5(val) { 
  43. var price = "";
  44. if (val<=15999){ price = "Invalid"; } 
  45. if (val>=16000 && val<=19999){ price = "$1,656"; }
  46. if (val>=20000 && val<=24999){ price = "$2,277"; }
  47. if (val>=25000 && val<=29999){ price = "$2,898"; }
  48. if (val>=30000 && val<=34999){ price = "$3,546"; }
  49. if (val>=35000 && val<=39999){ price = "$4,209"; }
  50. if (val>=40000 && val<=44999){ price = "$4,968"; }
  51. if (val>=45000 && val<=49999){ price = "$5,589"; }
  52. if (val>=50000 && val<=54999){ price = "$6,210"; }
  53. if (val>=55000 && val<=59999){ price = "$6,831"; }
  54. if (val>=60000 && val<=69999){ price = "$7,452"; }
  55. if (val>=70000 && val<=79999){ price = "$8,073"; }
  56. if (val>=80000){ price = "$8,694"; }
  57. document.form.op6.value = price;
  58. }
  59. </script> 
  60. <form name="form"><br>
  61. Unit amount:<br>
  62. <textarea onkeyup="count(this.innerHTML)" name="op31"></textarea><br>  
  63. Single Coat:<br> <input value="0" name="op4" /> <br>
  64. Double Coat:<br> <input value="0" name="op5" /> <br>
  65. Triple Coat:<br> <input value="0" name="op6" /> <br>
  66. </p>
  67. </form>
  68.  
Dec 3 '10 #1
0 1169

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

Similar topics

1
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...
0
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...
33
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...
2
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,...
3
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 ,
48
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...
2
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
2
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...
1
tuxalot
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...
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...
0
isladogs
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...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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$) { } ...
0
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...
0
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...
1
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...
0
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...

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.