You can use code similar to the following one, used by the Node module in node_filter_form()
.
// Build the 'Update options' form.
$form['options'] = array(
'#type' => 'fieldset',
'#title' => t('Update options'),
'#attributes' => array('class' => array('container-inline')),
'#access' => $admin_access,
);
// ...
$form['options']['operation'] = array(
'#type' => 'select',
'#title' => t('Operation'),
'#title_display' => 'invisible',
'#options' => $options,
'#default_value' => 'approve',
);
The key is the line settings the "#attributes" attribute to "container-inline."
That code is for Drupal 7; the equivalent code for Drupal 6 starts with the following code:
$form['options'] = array(
'#type' => 'fieldset',
'#title' => t('Update options'),
'#prefix' => '<div class="container-inline">',
'#suffix' => '</div>',
);
Supposing you are using Drupal 6, then your code should be changed to something similar to the following one:
function contact_register_form($form, &$form_state) {
$form['description'] = array(
'#type' => 'item',
'#title' => t('Sign up to be notified when your community launches:'),
);
$form['email'] = array(
'#type' => 'textfield',
'#title' => t('Email'),
'#prefix' => '<div class="container-inline">',
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => 'Add me',
'#suffix' => '</div>',
);
return $form;
}
I didn't put the description inline, as it would not be correctly rendered because it is using a "item" form field. I also find that inlining the description would cause the form to take too much space. (Imagine what would happen if the inlined description would be longer, and placed in a single line.)
The CSS styles that Drupal 7 adds to container-inline elements are the following.
/**
* Inline items.
*/
.container-inline div,
.container-inline label {
display: inline;
}
/* Fieldset contents always need to be rendered as block. */
.container-inline .fieldset-wrapper {
display: block;
}
They are added from system.base.css.