scsi
04-29-2003, 03:08 PM
hello,
i'm trying to add to the validation script for textbox also validation for checkbox, without good results.. here the code that works only for name and email fields..
<!-- form check field -->
function checkFields() {
missinginfo = "";
if (document.myform.name.value == "") {
missinginfo += "\n - Name";
}
if ((document.myform.email.value == "") ||
(document.myform.email.value.indexOf('@') == -1) ||
(document.myform.email.value.indexOf('.') == -1)) {
missinginfo += "\n - Email address";
}
if (document.myform.checkBOX.value == "") {
missinginfo += "\n - BOX";
}
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in your:\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}
thanks in advance for support
i'm trying to add to the validation script for textbox also validation for checkbox, without good results.. here the code that works only for name and email fields..
<!-- form check field -->
function checkFields() {
missinginfo = "";
if (document.myform.name.value == "") {
missinginfo += "\n - Name";
}
if ((document.myform.email.value == "") ||
(document.myform.email.value.indexOf('@') == -1) ||
(document.myform.email.value.indexOf('.') == -1)) {
missinginfo += "\n - Email address";
}
if (document.myform.checkBOX.value == "") {
missinginfo += "\n - BOX";
}
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in your:\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}
thanks in advance for support