Topic awaiting preservation: My brain is melting! (AKA Calculating form value avg) |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: Where I'm from isn't where I'm at! |
posted 10-24-2002 12:29
Hi again. code: <html>
code: if (element1.value == "0" ) {
|
Paranoid (IV) Inmate From: Where I'm from isn't where I'm at! |
posted 10-24-2002 13:48
I realy think I'm going mad! code: var totalScore = 0;
|
Paranoid (IV) Inmate From: Where I'm from isn't where I'm at! |
posted 10-24-2002 14:37
Oh, how the plot thickens!!! code: if (blockAvg1.value == NaN) {
|
Paranoid (IV) Inmate From: A graveyard of dreams |
posted 10-24-2002 16:34
To get rid of the NaN values all together you could do this: code: if (totalScore == 0) blockAvg1.value = 0;
code: if (blockAvg1.value == "NaN") {
|
Paranoid (IV) Inmate From: Where I'm from isn't where I'm at! |
posted 10-24-2002 16:59
I'd already tried the second idea, to no avail, but the code for skipping it altogether and inserting "0" works a treat. |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 10-24-2002 19:07
BTW: The proper, and safer, way to check for NaN is the isNaN() function. |