function FieldDiscoveryUtil() {
    var lstName = {};
    var result = [];

    function traverse(obj) {
        var obj = obj || document.getElementsByTagName('body')[0];

        var fieldUtil = FieldUtil.createInstance(obj);
        if (fieldUtil != null) {
            if (fieldUtil.type == 'radio' || fieldUtil.type == 'checkbox') {
                if (lstName[id] == null || !lstName[id]) {
                    // Mark this name so we dont find again
                    lstName[id] = true;
                } else
                    return;
            }
            if (fieldUtil.id != null) // Discard the input without id
                result.push(fieldUtil.getNodeConfiguration());
        } else if (obj.hasChildNodes()) {
            var child = obj.firstChild;
            while (child) {
                if (child.nodeType === 1 && child.nodeName != 'SCRIPT') {
                    traverse(child);
                }
                child = child.nextSibling;
            }
        }
    }

    this.getFields = function () {
        lstName = {};
        result = [];
        traverse();
        return result;
    };
}
// Util Class: get all HTML fields in the source code

Util Class: get all HTML fields in the source code
Util Class : get all HTML fields in the source code
function FieldDiscoveryUtil() {
    var lstName = {};
    var result = [];
    function traverse(obj) {
        var obj = obj || document.getElementsByTagName('body')[0];
        var fieldUtil = FieldUtil.createInstance(obj);
        if (fieldUtil != null) {
            if (fieldUtil.type == 'radio' || fieldUtil.type == 'checkbox') {
                if (lstName[id] == null || !lstName[id]) {
                    lstName[id] = true;
                } else
                    return;
            }
            if (fieldUtil.id != null) 
                result.push(fieldUtil.getNodeConfiguration());
        } else if (obj.hasChildNodes()) {
            var child = obj.firstChild;
            while (child) {
                if (child.nodeType === 1 && child.nodeName != 'SCRIPT') {
                    traverse(child);
                }
                child = child.nextSibling;
            }
        }
    }
    this.getFields = function () {
        lstName = {};
        result = [];
        traverse();
        return result;
    };
}
function FieldDiscoveryUtil ( ) { var lstName = { } ; var result = [ ] ; function traverse ( obj ) { var obj = obj || document . getElementsByTagName ( 'body' ) [ 0 ] ; var fieldUtil = FieldUtil . createInstance ( obj ) ; if ( fieldUtil != null ) { if ( fieldUtil . type == 'radio' || fieldUtil . type == 'checkbox' ) { if ( lstName [ id ] == null || ! lstName [ id ] ) { lstName [ id ] = true ; } else return ; } if ( fieldUtil . id != null ) result . push ( fieldUtil . getNodeConfiguration ( ) ) ; } else if ( obj . hasChildNodes ( ) ) { var child = obj . firstChild ; while ( child ) { if ( child . nodeType === 1 && child . nodeName != 'SCRIPT' ) { traverse ( child ) ; } child = child . nextSibling ; } } } this . getFields = function ( ) { lstName = { } ; result = [ ] ; traverse ( ) ; return result ; } ; }
Util Class: get all HTML fields in the source code
Util Class : get all HTML fields in the source code
// Mark this name so we dont find again
 // Discard the input without id
