First page Back Continue Last page Image
- New ValidBasedOnClass Function
- function validBasedOnClass(thisClass) {
- var classBack = "";
-
- switch(thisClass) {
- case "":
- case "invalid":
- break;
- case "reqd":
- if (allGood && thisTag.value == "") {
- classBack = "invalid ";
- }
- classBack += thisClass;
- break;
- case "radio":
- if (allGood && !radioPicked(thisTag.name)) {
- classBack = "invalid ";
- }
- classBack += thisClass;
- break;
- case "isNum":
- case "isZip":
- case "email":
- classBack += thisClass;
- break;
- default:
- if (allGood && !crossCheck(thisTag,thisClass)) {
- classBack = "invalid ";
- }
- classBack += thisClass;
- }
- return classBack;
- function radioPicked(radioName) {
- var radioSet = document.forms[0][radioName];
-
- if (radioSet) {
- for (k=0; k<radioSet.length; k++) {
- if (radioSet[k].checked) {
- return true;
- }
- }
- }
- return false;
- }
- This is the code added to check the Radio Buttons
- Is at least 1 of the radio boxes checked?