Ajax.serialize dealing with submit

Ajax.serialize dealing with submit


Hey everyone,
So i was trying to use the .serialize() function found in the library
and I discovered that the function does not take into consideration
the input type submit. This is weird since the documentation does not
point this out. Furthermore, I think that this input type should be
part of the output since it probably is usefull to determining the
action on the server side.
Can someone explain the reason behind this decision? or is this a bug
that needs to be fixed.
///// serialize function from jquery-1.3.2
serialize: function() {
        return jQuery.param(this.serializeArray());
    },
    serializeArray: function() {
        return this.map(function(){
            return this.elements ? jQuery.makeArray(this.elements) : this;
        })
        .filter(function(){
            return this.name && !this.disabled &&
                (this.checked || /select|textarea/i.test(this.nodeName) ||
                    /text|hidden|password|search/i.test(this.type)); //<<- here would
be the missing type submit
        })
        .map(function(i, elem){
            var val = jQuery(this).val();
            return val == null ? null :
                jQuery.isArray(val) ?
                    jQuery.map( val, function(val, i){
                        return {name: elem.name, value: val};
                    }) :
                    {name: elem.name, value: val};
        }).get();
    }
});