I need to check a form for input. I need it to check if values are in a certain range and if they are I need to have them enter two more values. I found that I need to check if the the two more values are actually there also.
here is the code:
<– START SCRIPT –>
function checkform() {
var str = document.levels.mac.value;
if (document.levels.ctxpwr.value == “”) {
alert(“Enter TX Level”);
return(false);
}
if (document.levels.crxpwr.value == “”) {
alert(“Enter RX Level”);
return(false);
}
if (document.levels.csnr.value == “”) {
alert(“Enter SNR Ratio”);
return(false);
}
if (str.length < 12) {
alert(“MAC Address needs to be 12 Characters”);
return(false);
}
if (!(document.levels.ctxpwr.value == “”) && document.levels.ctxpwr.value < 36 || document.levels.ctxpwr.value > 50 && document.levels.taptx.value == “” || document.levels.taprx.value == “”) {
alert(“Failing Install – Please Enter Tap Values”);
return(false);
}
if (!(document.levels.crxpwr.value == “”) && document.levels.crxpwr.value > 10 || !(document.levels.crxpwr.value < -10) && document.levels.
taptx.value == “” || document.levels.taprx.value == “”) {
alert(“Failing Install – Please Enter Tap Values”);
return(false);
}
if (!(document.levels.csnr.value == “”) && document.levels.csnr.value < 30) && document.levels.taptx.value == “” || document.levels.taprx.value == “” {
alert(“Failing Install – Please Enter Tap Values”);
return(false);
}
return(true);
<– END SCRIPT –>
Problem is if the values are TRUE to out of spec then it doesnt Alert.