show a form in a popup when a button is pressed
Another solution is to use Ctools Automodal module. This approach is less complicated to @Web-Beest answer.

Here is the example on how to use it.

function mymodule_menu() {
  $items['mymodule/form'] = array(
    'page callback' =&gt; 'drupal_get_form',
    'page arguments' =&gt; array('mymodule_form'),
    'access arguments' =&gt; array('administer mymodule'),
    'modal' =&gt; TRUE, 
  );
}


The most important line in the above code is 'modal' =&gt; TRUE,.