|
Here is an example of one of my If statements that does not work. If I type a value other than 0, 1, or 2 the alert should pop up, but it doesn't. Any suggestions?
function APGAR() {
if(field.value==0 || field.value==1 || field.value==2) {
var A=eval(document.REG.ACT.value);
var P=eval(document.REG.PULSE.value);
var G=eval(document.REG.GRIMACE.value);
var AP=eval(document.REG.APP.value);
var R=eval(document.REG.RESP.value);
document.REG.TOTAL.value=A+P+G+AP+R;
} else {
alert("You must enter a 0, 1, or 2");
field.focus();
}
}
|