dist/garnish.js
function(container) {
        var postData = {},
            arrayInputCounters = {},
            $inputs = Garnish.findInputs(container);

        var inputName;

        for (var i = 0; i < $inputs.length; i++) {
            var $input = $inputs.eq(i);

            if ($input.prop('disabled')) {
                continue;
            }

            inputName = $input.attr('name');
            if (!inputName) {
                continue;
            }

            var inputVal = Garnish.getInputPostVal($input);
            if (inputVal === null) {
                continue;
            }

            var isArrayInput = (inputName.substr(-2) === '[]');

            if (isArrayInput) {
                // Get the cropped input name
                var croppedName = inputName.substring(0, inputName.length - 2);

                // Prep the input counter
                if (typeof arrayInputCounters[croppedName] === 'undefined') {
                    arrayInputCounters[croppedName] = 0;
                }
            }

            if (!Garnish.isArray(inputVal)) {
                inputVal = [inputVal];
            }

            for (var j = 0; j < inputVal.length; j++) {
                if (isArrayInput) {
                    inputName = croppedName + '[' + arrayInputCounters[croppedName] + ']';
                    arrayInputCounters[croppedName]++;
                }

                postData[inputName] = inputVal[j];
            }
        }

        return postData;
    }
function(container) {
        var postData = {},
            arrayInputCounters = {},
            $inputs = Garnish.findInputs(container);

        var inputName;

        for (var i = 0; i < $inputs.length; i++) {
            var $input = $inputs.eq(i);

            if ($input.prop('disabled')) {
                continue;
            }

            inputName = $input.attr('name');
            if (!inputName) {
                continue;
            }

            var inputVal = Garnish.getInputPostVal($input);
            if (inputVal === null) {
                continue;
            }

            var isArrayInput = (inputName.substr(-2) === '[]');

            if (isArrayInput) {
                // Get the cropped input name
                var croppedName = inputName.substring(0, inputName.length - 2);

                // Prep the input counter
                if (typeof arrayInputCounters[croppedName] === 'undefined') {
                    arrayInputCounters[croppedName] = 0;
                }
            }

            if (!Garnish.isArray(inputVal)) {
                inputVal = [inputVal];
            }

            for (var j = 0; j < inputVal.length; j++) {
                if (isArrayInput) {
                    inputName = croppedName + '[' + arrayInputCounters[croppedName] + ']';
                    arrayInputCounters[croppedName]++;
                }

                postData[inputName] = inputVal[j];
            }
        }

        return postData;
    }
function ( container ) { var postData = { } , arrayInputCounters = { } , $inputs = Garnish . findInputs ( container ) ; var inputName ; for ( var i = 0 ; i < $inputs . length ; i ++ ) { var $input = $inputs . eq ( i ) ; if ( $input . prop ( 'disabled' ) ) { continue ; } inputName = $input . attr ( 'name' ) ; if ( ! inputName ) { continue ; } var inputVal = Garnish . getInputPostVal ( $input ) ; if ( inputVal === null ) { continue ; } var isArrayInput = ( inputName . substr ( - 2 ) === '[]' ) ; if ( isArrayInput ) { // Get the cropped input name var croppedName = inputName . substring ( 0 , inputName . length - 2 ) ; // Prep the input counter if ( typeof arrayInputCounters [ croppedName ] === 'undefined' ) { arrayInputCounters [ croppedName ] = 0 ; } } if ( ! Garnish . isArray ( inputVal ) ) { inputVal = [ inputVal ] ; } for ( var j = 0 ; j < inputVal . length ; j ++ ) { if ( isArrayInput ) { inputName = croppedName + '[' + arrayInputCounters [ croppedName ] + ']' ; arrayInputCounters [ croppedName ] ++ ; } postData [ inputName ] = inputVal [ j ] ; } } return postData ; }
Returns the post data within a container.

@param {object} container
@return {array}
Returns the post data within a container .