Building Custom Drupal Form
You should replace

function mymodule_form_generate() {
  $form = array();


with 

function mymodule_form_generate($form, &amp;$form_state) {


I'm not sure if this fixes things for you, but that is the only thing I can see that is out of order.