PDA

View Full Version : text field correlation and calculations



mackieinva
05 Feb 2009, 01:01 PM
hi everyone, a friend asked me to overlook a javascript problem and I don't know where to begin. He has a page where you enter a number in text fields for quantity and then a javascript function will take those numbers, place them in text fields at the bottom and then use those numbers to calculate the price. In turn take that price and place it in the total field.

right now some numbers come up as NaN, some work, some don't show up at all. I was trying to find new functions completely to put in there to complete the tasks if I couldn't fix it and I don't even know where to begin.

http://www.documentlabels.com is the website.

If you can point me in the direction of a place to find functions I can copy and paste in place or maybe help me find the problem I really appreciate it.

Erik
10 Feb 2009, 03:19 PM
The first thing I see is 6 functions with different names that appear to do exactly the same thing. calcQty2, 3, 4 etc. This is the first sign something has gone off the rails as far as the logic goes.

The next most obvious problem I see is that the function BlockAll does not seem to exist anywhere.

I'd start by streamlining the functions so that your calculation logic is happening in only one place, and figuring out what the function BlockAll is supposed to be.

I'll offer more help as you need it.

-Erik