forms – What is the best UI for multi-selecting from a list?

Use a popup window (aka overlay, modal) to display the checkboxes and let the user select multiple values.

The popup window is opened when a user clicks on an edit link on the main form.

When he’s done selecting the values, he can click a DONE button, which has a click event, a javascript method which gathers the checked values and updates some hidden field on the main form and/or some display field (eg readonly text area, or a span or a div element) on the main form. And when the user clicks on the main submit button, the hidden field or display field is sent to the server
for persistence.

If there’s a large number of checkboxes to select from, then displaying them
can take up a very large screen real estate, so a popup window can be styled
without clutter to help focus the user’s attention. When he’s done, he can close the window.

Of course multiple steps could also make sense. But my solution is for a single submit form.

What do you think of this method? Is it a pattern already being used?