By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,483 Members | 1,727 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,483 IT Pros & Developers. It's quick & easy.

function not defined in browser

P: 22
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
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
Can you show the exact error message and what line it points to.
Aug 9 '08 #2

Post your reply

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