No error messages from validate? I'm creating a simple contact form and it works flawlessly, besides the validation.

When I try to exercise the validate function, no error messages are shown. The text in the correspondent field turns red, so that works, but where is the messages?

If I fill in the form correctly and the mail gets sent, messages are shown just like they should.

Here's my code:

function mymodule_buysell_contact_form($form, &amp;$form_state) {
    // The form

    $form['contact'] = array(

        '#title' =&gt; t('Skicka ett meddelande till säljaren'),

        '#type' =&gt; 'fieldset'

    );
    $form['contact']['message'] = array(

        '#type' =&gt; 'textarea',

        '#title' =&gt; t('Meddelande:'),

        '#cols' =&gt; 35,

        '#rows' =&gt; 6,

        '#resizable' =&gt; FALSE

    );
    $form['contact']['name'] = array(

        '#type' =&gt; 'textfield',

        '#title' =&gt; t('Ditt Namn:'),

        '#size' =&gt; 35,

        '#maxlength' =&gt; 30

    );
    $form['contact']['compname'] = array(

        '#type' =&gt; 'textfield',

        '#title' =&gt; t('Företag:'),

        '#size' =&gt; 35,

        '#maxlength' =&gt; 30

    );
    $form['contact']['phone'] = array(

        '#type' =&gt; 'textfield',

        '#title' =&gt; t('Telefon:'),

        '#size' =&gt; 35,

        '#maxlength' =&gt; 30

    );
    $form['contact']['cellphone'] = array(

        '#type' =&gt; 'textfield',

        '#title' =&gt; t('Mobiltelefon:'),

        '#size' =&gt; 35,

        '#maxlength' =&gt; 30

    );

    $form['contact']['mail'] = array(

        '#type' =&gt; 'textfield',

        '#title' =&gt; t('Din E-mail:'),

        '#size' =&gt; 35,

        '#maxlength' =&gt; 30

    );

    $form['contact']['captcha'] = array (
        '#type' =&gt; 'captcha',
        '#captcha_type' =&gt; 'image_captcha/Image',
    );

    $form['contact']['submit'] = array(

        '#type' =&gt; 'submit',

        '#value' =&gt; t('Skicka')

    );

    return $form;
    }

    function mymodule_buysell_contact_form_validate($form, &amp;$form_state) {
    // Validate message

    $valid_message = $form_state['values']['message'];

        if (empty($valid_message)) {

        form_set_error('message', 'Du har inte skrivit något meddelande');

        }
    // Validate if a name is submitted

    $valid_name = $form_state['values']['name'];

        if (empty($valid_name)) {

        form_set_error('name', 'Du har inte fyllt i ett namn');

        }

    // Validate if a company name is submitted

    $valid_compname = $form_state['values']['compname'];

        if (empty($valid_compname)) {

        form_set_error('compname', 'Du har inte fyllt i ditt företagsnamn');

        }
    // Validate phone by look for numbers

    $valid_phone = $form_state['values']['phone'];

        if (!is_numeric($valid_phone)) {

        form_set_error('phone', 'Ditt nummer verkar inte vara korrekt ifyllt (endast siffror)');

        }
    // Validate cellphone by look for numbers

    $valid_cellphone = $form_state['values']['cellphone'];

        if (!is_numeric($valid_cellphone)) {

        form_set_error('cellphone', 'Ditt mobilnummer verkar inte vara korrekt ifyllt (endast siffror)');

        }

    // Validate the mail, using Drupals own function

    $valid_email = $form_state['values']['mail'];

        if (!valid_email_address($valid_email)) {

        form_set_error('mail', 'Din Epost verkar inte vara korrekt ifylld');

        }
}
For fieldsets I think you have to include the parent as well.

Try changing 

form_set_error('phone', 'Ditt nummer v.... 
to 

form_set_error('contact][phone', 'Ditt nummer v....

You can read more here: http://drupal.org/node/678816