Keep Focus inside a PopUp

Sounds like you want what's called a "modal" popup.

This thread offers a few different approaches: