Axel: Here's a hint for you.
Computer languages in general, and JavaScript in particular, execute code IN THE ORDER that it appears in your coding text. They don't "look ahead" to find values that haven't been obtained yet, for example. [Yes, yes...I know function names are a huge exception...but that doesn't apply in this case.]
So look at your code, just the first few lines:
Code:
var weight, waist, bodyfat, total bodyfat
if ( (weight >=0) , (waist >=0) , (total bodyfat >=0) )
At the point were you are trying to do
weight >= 0 what do you think the value of
weight is?
HINT: You never defined a value. So it has no value. (Or, rather, it has a value of
null, but that is useless to you.)
Same is, of course, true for
waist.
The case of
total bodyFat is more egregious. You have a space in the middle of what I *assume* is supposed to be
totalbodyFat. KABLOOEY. JavaScript doesn't permit spaces in names.
Mind you, these are just the *beginning* of your errors.
Just for one more example (and there are others!) you do
Code:
weight = Math.round(weightBox x 1.082) + 94.42
but you have never defined a variable named
weightBox so the value of *THAT* variable is
null and you can't then multiply it by anything.
In short, what you have there is pretty much total hash.
Start all over again.
Remember what I said: JavaScript executes the code *IN THE SAME ORDER* that you wrote it. It can't use values at point A when they aren't defined until point B in the code (and B follows A).