function forEachInputElementByTagNameAndStyleClass(elementTagNames, styleClassName, callback, reverse) {
    	for (var k=0; k<elementTagNames.length; k++) {
    		var elementTagName = elementTagNames[k];
    		var inputFields = document.getElementsByTagName(elementTagName);
    		for (var i = (reverse?inputFields.length-1:0); (reverse?i>=0:i<inputFields.length); (reverse?i--:i++)) {
    			if (inputFields[i].className) {
    				var styleClasses = inputFields[i].className.split(' ');
    				for (var j = 0; j<styleClasses.length; j++) {
    					if (styleClasses[j]==styleClassName) {
    						//console.log("forEachInputElementByStyleClass: " + styleClassName + " → will invoke callback for '" + inputFields[i].id + "'");
    						if (callback(inputFields[i])) {
    							return;
    						}
    						//console.log("forEachInputElementByStyleClass: return was not false, will remove the class and process next one");
    						// Remove the class name to avoid processing it multiple times if this method is invoked again
    						inputFields[i].className = inputFields[i].className.replace(styleClassName, "").trim();
    						// Invoke the callback with the matching element. If it returns true we stop looking for more elements.
    						break;
    					}
    				}
    			}
    		}
    	}
    }
/** Process the callback on each input element that matches the provided style class. */
Process the callback on each input element that matches the provided style class.
Process the callback on each input element that matches the provided style class .
function forEachInputElementByTagNameAndStyleClass(elementTagNames, styleClassName, callback, reverse) {
    	for (var k=0; k<elementTagNames.length; k++) {
    		var elementTagName = elementTagNames[k];
    		var inputFields = document.getElementsByTagName(elementTagName);
    		for (var i = (reverse?inputFields.length-1:0); (reverse?i>=0:i<inputFields.length); (reverse?i--:i++)) {
    			if (inputFields[i].className) {
    				var styleClasses = inputFields[i].className.split(' ');
    				for (var j = 0; j<styleClasses.length; j++) {
    					if (styleClasses[j]==styleClassName) {
    						if (callback(inputFields[i])) {
    							return;
    						}
    						inputFields[i].className = inputFields[i].className.replace(styleClassName, "").trim();
    						break;
    					}
    				}
    			}
    		}
    	}
    }
function forEachInputElementByTagNameAndStyleClass ( elementTagNames , styleClassName , callback , reverse ) { for ( var k = 0 ; k < elementTagNames . length ; k ++ ) { var elementTagName = elementTagNames [ k ] ; var inputFields = document . getElementsByTagName ( elementTagName ) ; for ( var i = ( reverse ? inputFields . length - 1 : 0 ) ; ( reverse ? i >= 0 : i < inputFields . length ) ; ( reverse ? i -- : i ++ ) ) { if ( inputFields [ i ] . className ) { var styleClasses = inputFields [ i ] . className . split ( ' ' ) ; for ( var j = 0 ; j < styleClasses . length ; j ++ ) { if ( styleClasses [ j ] == styleClassName ) { if ( callback ( inputFields [ i ] ) ) { return ; } inputFields [ i ] . className = inputFields [ i ] . className . replace ( styleClassName , "" ) . trim ( ) ; break ; } } } } } }
Process the callback on each input element that matches the provided style class.
Process the callback on each input element that matches the provided style class .
//console.log("forEachInputElementByStyleClass: " + styleClassName + " → will invoke callback for '" + inputFields[i].id + "'"); //console.log("forEachInputElementByStyleClass: return was not false, will remove the class and process next one"); // Remove the class name to avoid processing it multiple times if this method is invoked again // Invoke the callback with the matching element. If it returns true we stop looking for more elements.