jQuery.fn.selectsubmit = function() {
    /* When called on a select input, make it so the select input's form will
     * be submitted whenever the select input is changed. If the new value is
     * an empty string, the form won't be submitted. */
    return this.each(function() {
            $(this)
                .change(function() {
                    /* Submit the form. */
                    jQuery(this.form).submit();
                });
    });
};

