rem: value=1; 
add: value = 1; 
context: function validateForm(theFormname,theFieldlist,goodMess,badMess,emailMess)	{	var formObject = document[theFormname];	if (!formObject)	{		formObject = document.getElementById(theFormname);	}	if (formObject && theFieldlist)	{		var index=1;		var theField = split(theFieldlist, ",", index);		var msg="";		var theEreg = '';		var theEregMsg = '';		var specialMode = '';		while (theField) {			theEreg = '';			specialMode = '';				// Check special modes:			if (theField == '_EREG')	{	// EREG mode: _EREG,[error msg],[JS ereg],[fieldname],[field Label]				specialMode = theField;				index++;				theEregMsg = unescape(split(theFieldlist, ",", index));				index++;				theEreg = unescape(split(theFieldlist, ",", index));			} else if (theField == '_EMAIL')	{				specialMode = theField;			}				// Get real field name if special mode has been set:			if (specialMode)	{				index++;				theField = split(theFieldlist, ",", index);			}			index++;			theLabel = unescape(split(theFieldlist, ",", index));			theField = unescape(theField);			if (formObject[theField])	{				var fObj = formObject[theField];				var type=fObj.type;				if (!fObj.type)	{					type="radio";				}				var value="";				switch(type)	{					case "text":					case "textarea":						value = fObj.value;					break;					case "select-one":						if (fObj.selectedIndex>=0)	{							value = fObj.options[fObj.selectedIndex].value;						}					break;					case "select-multiple":						var l=fObj.length;						for (a=0;a<l;a++)	{							if (fObj.options[a].selected)	{								 value+= fObj.options[a].value;							}						}					break;					case "radio":						var len=fObj.length;						if (len)	{							for (a=0;a<len;a++)	{								if (fObj[a].checked)	{									value = fObj[a].value;								}							}						} else {							if (fObj.checked)	{								value = fObj.value;							}						}					break;					default:						value=1;				}				switch(specialMode)	{					case "_EMAIL":						var theRegEx_notValid = new RegExp("(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)", "gi");						var theRegEx_isValid = new RegExp("^.+\@[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})$","");						if (!theRegEx_isValid.test(value))	{	// This part was supposed to be a part of the condition: " || theRegEx_notValid.test(value)" - but I couldn't make it work (Mozilla Firefox, linux) - Anyone knows why?							msg+="\n"+theLabel+' ('+(emailMess ? unescape(emailMess) : 'Email address not valid!')+')';						}					break;					case "_EREG":						var theRegEx_isValid = new RegExp(theEreg,"");						if (!theRegEx_isValid.test(value))	{							msg+="\n"+theLabel+' ('+theEregMsg+')';						}					break;					default:						if (!value)	{							msg+="\n"+theLabel;						}				}			}			index++;			theField = split(theFieldlist, ",", index);		}		if (msg)	{			var theBadMess = unescape(badMess);			if (!theBadMess)	{				theBadMess = "You must fill in these fields:";			}			theBadMess+="\n";			alert(theBadMess+msg);			return false;		} else {			var theGoodMess = unescape(goodMess);			if (theGoodMess)	{				alert(theGoodMess);			}			return true;		}	}}
meta: 9100	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/9100/8d6ea324561d52468a9331db8ec8049811209fa1/jsfunc.validateform.js/buggy/t3lib/jsfunc.validateform.js