When the drupal search form and Author Contact forms are on the same page it produces invalid XHTML because they both share the same submit button name.

The form definition should be changed to something like:

    $form['send'] = array(
        '#type' => 'submit',
        '#value' => t('Send')
    );

Comments

budda’s picture

When this form appears on a page containing a user login block its fields also clash. A suggested form definition would be:

 function authorcontact_form() {

	 $form['sendgroup'] = array(
				 '#type' => 'fieldset',
				 '#title' => t('Contact author'),
				 '#collapsible' => true,
				 '#collapsed' => true
	 );

    $form['sendgroup']['sendername'] = array(
        '#title' => t('Your name'),
        '#type' => 'textfield',
        '#size' => 15,
        '#required' => true
    );
    $form['sendgroup']['senderemail'] = array(
        '#title' => t('Email'),
        '#type' => 'textfield',
        '#size' => 15,
        '#required' => true
    );
    $form['sendgroup']['sendercomment'] = array(
        '#title' => t('Comment'),
        '#type' => 'textarea',
        '#cols' => 12,
        '#rows' => 4,
        '#required' => true
    );
    $form['sendgroup']['send'] = array(
        '#type' => 'submit',
        '#value' => t('Send')
    );
    return $form;
 }

Works for me when validating HTML.

JmsCrk’s picture

Status: Active » Fixed

Thanks for the tips, fixed the form and included a fieldset as suggested

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.