Why is my form handler not running? I've created a custom module which creates a form and shows it in a block but whenever I submit it, it just refreshes the page and doesn't seem to execute the submit handler at all.

I'm going crazy trying to get this to work.

I've stripped the code right back but it's still not working.

&lt;?php

// declare block info
function paypoint_block_info() {
    $blocks['paypoint_block'] = array(
        'info' =&gt; t('Paypoint Payment Form'), // block admin title
        'cache' =&gt; DRUPAL_NO_CACHE,
    );

    return $blocks;
}

// declare block functions
function paypoint_block_view($delta = '') {
    switch ($delta) {
        case 'paypoint_block':
            $block['content'] = drupal_get_form('paypoint_form');
            return $block;
            break;
    }

}

function paypoint_form($form, &amp;$form_state) {
    $form['#attributes'] = array('class' =&gt; 'content-page-form');

    $form['strForename'] = array(
        '#type' =&gt; 'textfield', //you can find a list of available types in the form api
        '#title' =&gt; 'Forename',
        '#size' =&gt; 30,
        '#maxlength' =&gt; 37,
        '#required' =&gt; TRUE, //make this field required
    );

    $form['submit'] = array(
        '#type' =&gt; 'submit',
        '#value' =&gt; t('Make a payment'),
        '#attributes' =&gt; array('class' =&gt; array('btn', 'btn-default')),
    );

    return $form;
}

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

}

function paypoint_form_submit($form, &amp;$form_state) {
    drupal_set_message($form_state['values']['strForename']);
}


The validate function seems to get called, just not the submit one. I put print_r($form) in the validate function and got this: http://pastebin.com/Yt6T6Cr8
Your code looks fine to me. I think you might be on to something with your last comment, there might be something interfering with the hook. 

One thing you might wanna do is run module_implements and look for the submit hook. That should give you a list of modules that implement that hook. At the very least you can check to see if there is anything strange going on with those modules.