I am trying to ensure that a value is entered in two areas (the first two parts of the if statement below) and something other than 0 is entered into the remaining 11 (which are dropdowns). I know the names/ids of the objects are correct. This isn't working.
Basically something has to be entered into one of the first two inputs OR one of the other 11 has to have something other than '0' selected.
Can someone tell me if they see any syntactical issues?
Thanks!
I believe it has something to do with the values of the last 11 items being 0. I tried enclosing them in single quotes but that didn't work either.
Thanks!
Basically something has to be entered into one of the first two inputs OR one of the other 11 has to have something other than '0' selected.
Can someone tell me if they see any syntactical issues?
Thanks!
Code:
if (document.enter_trng.miles.value == '' && document.enter_trng.minutes.value == '' && document.enter_trng.Bike.value == 0 && document.enter_trng.WgtTrng.value == 0 && document.enter_trng.PoolRun.value == 0 && document.enter_trng.Swim.value == 0 && document.enter_trng.RollerBlade.value == 0 && document.enter_trng.RollerSki.value == 0 && document.enter_trng.NordicSki.value == 0 && document.enter_trng.Calisthenics.value == 0 && document.enter_trng.Eliptical.value == 0 && document.enter_trng.Yoga.value == 0 && document.enter_trng.Misc.value == 0) { alert('You have not entered any training.'); return false } else return true; }
Thanks!
Comment