partial cherrypick
cherry-picked more fixes for multiselect form from multiselect-paginate branch