rem: while(element.childNodes[0]) element.removeChild(element.childNodes[0]); 
add: wBehavior.switchedOffFields.push(element); 
context: 			validateElement: function(element /*, currentPageOnly, deep */) {				var deep = arguments.length>2 ? arguments[2] : true;								// used in multi-page forms				var currentPageOnly = arguments[1] ? arguments[1] : false;												var wBehavior = wFORMS.behaviors['validation'];		// shortcut								// do not validate elements that are in a OFF-Switch				// Note: what happens if an element is the target of 2+ switches, some ON and some OFF ?				if(wFORMS.hasBehavior('switch') && wFORMS.helpers.hasClassPrefix(element,wFORMS.classNamePrefix_offState)) {					if(!wBehavior.submitSwitchedOffFields) {						while(element.childNodes[0]) 							element.removeChild(element.childNodes[0]);					}					return 0;				}				// do not validate elements that are not in the current page (Paging Behavior)				if(wFORMS.hasBehavior('paging') && wFORMS.helpers.hasClass(element,wFORMS.className_paging)) {					if(!wFORMS.helpers.hasClass(element,wFORMS.className_pagingCurrent) && currentPageOnly)						return 0;					wBehavior.currentPageIndex = wFORMS.behaviors['paging'].getPageIndex(element);				}								var nbErrors = 0;								// check if required				if(!wBehavior.checkRequired(element)) {					wBehavior.showError(element, wBehavior.errMsg_required);					nbErrors++;					//wFORMS.debug('validation/error: [required]' + element.id + '('+nbErrors+')' , 5);				} else {									// input format validation					if (wFORMS.helpers.hasClassPrefix(element,wFORMS.classNamePrefix_validation)) {								var arrClasses = element.className.split(" ");						for (j=0;j<arrClasses.length;j++) {							switch(arrClasses[j]) {								case "validate-alpha":									if(!wBehavior.isAlpha(element.value)) {										wBehavior.showError(element, wBehavior.errMsg_alpha);										nbErrors++;									}									break;								case "validate-alphanum":									if(!wBehavior.isAlphaNum(element.value)) {										wBehavior.showError(element, wBehavior.errMsg_alphanum);										nbErrors++;									}									break;								case "validate-date":									if(!wBehavior.isDate(element.value)) {										wBehavior.showError(element, wBehavior.errMsg_date);										nbErrors++;									}									break;								case "validate-time":									/* NOT IMPLEMENTED */									break;								case "validate-email":									if(!wBehavior.isEmail(element.value)) {										wBehavior.showError(element, wBehavior.errMsg_email);										nbErrors++;									}									break;								case "validate-integer":									if(!wBehavior.isInteger(element.value)) {										wBehavior.showError(element, wBehavior.errMsg_integer);										nbErrors++;									}														break;								case "validate-float":									if(!wBehavior.isFloat(element.value)) {										wBehavior.showError(element,wBehavior.errMsg_float);										nbErrors++;									}									break;								case "validate-strongpassword": // NOT IMPLEMENTED									if(!wBehavior.isPassword(element.value)) {										wBehavior.showError(element, wBehavior.errMsg_password);										nbErrors++;									}									break;								case "validate-custom": 									var pattern = new RegExp("\/([^\/]*)\/([gi]*)");									var matches = element.className.match(pattern);									if(matches[0]) {																				var validationPattern = new RegExp(matches[1],matches[2]);										if(!element.value.match(validationPattern)) {											wBehavior.showError(element, wBehavior.errMsg_custom);											nbErrors++;																					}									}																								break;																} // end switch						} // end for					}				} // end validation check								// remove previous error flags if any.				if(nbErrors==0) {					wBehavior.removeErrorMessage(element);				} else {					// flag the first page with an error (if multi-page form)					if(wBehavior.currentPageIndex>0 && !wBehavior.jumpToErrorOnPage) {						wBehavior.jumpToErrorOnPage = wBehavior.currentPageIndex;					}				}									// recursive loop									if(deep) {					for(var i=0; i < element.childNodes.length; i++) {						if(element.childNodes[i].nodeType==1) { // Element Nodes only							nbErrors += wBehavior.validateElement(element.childNodes[i], currentPageOnly, deep);						}					}				}								return nbErrors;			},
meta: 8955	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/8955/7e710b9ad8367505816b34b3c58c714f597104d4/wforms.js/clean/trunk/wforms.js