473,473 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

function not defined in browser

22 New Member
hello all, i am having another problem with a file i am working on. acoder was great enough to help me to get it working but now when i came back to it today, its telling me that the function isn't defined. so here it is:

Expand|Select|Wrap|Line Numbers
  1.  
  2. function getPrice()
  3.  
  4.  
  5. {
  6.  
  7.     var qty = parseInt(document.prodform.quantity.value, 10);
  8.     var y = document.prodform.price.value;
  9.     var num = new Number(document.prodform.price.value);
  10.             num.toFixed(2);    
  11.  
  12.     if (qty >= 12 && qty < 24) {
  13.  
  14.       y =  (qty * 3.17)
  15.         document.prodform.price.value = y;
  16.  
  17.  
  18.       } else if (qty >= 24 && qty < 36) {
  19.  
  20.         y =  qty * 2.95; 
  21.         document.prodform.price.value = y;
  22.  
  23.  
  24.       } else if (qty >= 36 && qty < 72) {
  25.  
  26.         y =  qty * 2.72;
  27.         document.prodform.price.value = y;
  28.  
  29.  
  30.       } else if (qty >= 72 && qty < 144) {
  31.  
  32.         y =  qty * 2.27; 
  33.         document.prodform.price.value = y;
  34.  
  35.        } else if (qty >= 144 && qty < 288) {
  36.  
  37.           y =  qty * 1.94; 
  38.         document.prodform.price.value = y;
  39.  
  40.         } else if (qty >= 288 && qty < 576) {
  41.  
  42.           y =  qty * 1.92; 
  43.         document.prodform.price.value = y;
  44.  
  45.  
  46.         } else if(qty >= 576 && qty < 1008){
  47.  
  48.         y =  qty * 1.88; 
  49.         document.prodform.price.value = y;    
  50.  
  51.  
  52.         } else if (qty >= 1008 && qty < 2016) {
  53.  
  54.         y =  qty * 1.85; 
  55.             document.prodform.price.value = y;
  56.  
  57.  
  58.         } else if  (qty <= 2016){
  59.  
  60.         y =  qty * 1.81; 
  61.         document.prodform.price.value = y;
  62.  
  63.  
  64.         }
  65.  
  66.  
  67.  
  68. }
  69.  
  70.  
Aug 8 '08 #1
1 1092
acoder
16,027 Recognized Expert Moderator MVP
Can you show the exact error message and what line it points to.
Aug 9 '08 #2

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

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
1
by: Jehan | last post by:
At the end of my HTML page I have following..... <script> for (i = 0; i < document.section_entry.length;i++) { // some code } </script>
2
by: laredotornado | last post by:
Hello, I am looking for a cross-browser way (Firefox 1+, IE 5.5+) to have my Javascript function execute from the BODY's "onload" method, but if there is already an onload method defined, I would...
2
by: Bootstrap Bill | last post by:
I want to create a Windows Form in C# that has a web browser componant on it. If I load a web page into the web browser containing jscript, can jscript call a C# function on my form?
3
by: laredotornado | last post by:
Hello, What is a cross-browser way to check if a function has been defined? It seems that this code if (myFn) { myFn(); }
1
by: finerrecliner | last post by:
what i'm trying to accomplish: user clicks button. then can click 2 more times anywhere on the page and display his mouse coordinates. after those 2 clicks, go back to normal mouse behavior the...
2
by: NightWalker | last post by:
Hi, I'm having a little trouble with a javascript function that I can't get to work but can't find the reason why. I have the folowing code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0...
3
pbmods
by: pbmods | last post by:
AN INTRODUCTION TO FUNCTION OBJECTS LEVEL: INTERMEDIATE PREREQS: OBJECTS You've seen it before. You're setting up an XMLHttpRequest call, and you need to execute a function when it returns, so...
32
by: David Mark | last post by:
I've got a collection of functions that accept a function or object (paired with a method name) as a callback. For the longest time I have relied on this test. (typeof cb == 'function') ...
2
by: Bob | last post by:
Hi, i know what the javascript function Page_ClientValidate() function does: tests if all controls meet asp.net validation criteria. This function is provided by asp.net. But how can a browser...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.