Hmmm, I do not understand your code.
So, you have this section: onclick=‘Total(“qty”,-1,“total”,463.50);’
This sends a string “QTY” and another string “TOTAL” to the function Total.
Then, in the Total routine, you use the QTY text to get the address by respawning the variable
“qty” from a string into a pointer to the variable “qty” which you then try to use?
This does not make sense. If you already know the name of an area that you want to use
in a function, just use it.
Also, if why create a function calcArea and do nothing in it? Just use the L*W where it is needed.
The main issue when programming is to keep it simple and not make the server work harder than
it needs to. So the function calcArea is just slowing down your code.
In the calc function, you create a new variable ‘f’ which is created whenever the function is called.
Then, you do some calculations and assign the value to the newly formed ‘f’ variable. Then, you
exit the function never doing anything with the calculations.
You need to study “SCOPE” of variables in JavaScript coding. Inside of functions, variables are in a
separate world and do not mean anything outside the function. (Unless you have declared them as
“GLOBAL” or another outside the function assignment.)
You need to “RETURN” your data out of a function to get it back to the calling variable.
But, to start with, here is a link to learn JavaScript from. It starts out simple and walks thru a lot of the
common questions. Just keep hitting the “Next-Chapter” link to continue on and on… I think it will help.
When you have another version ready, post it and we can help you with it. But, please post the code
inside of the PHP tags. Just above where you type. Place your code inside the tags. code
Good luck… We are here when you get your next version ready…