function gng_unsubscribe_form($form,&$form_state) {
 $form['email'] = array(
 '#title' => 'Email',

'#type' => 'textfield',
 '#prefix' => '<div class="btn-area">',
 '#suffix' => '</div>'
 return $form;

For a particular field I can add custom class using #prefix and #suffix, is there a way to add wrapping div around whole form?

1 Answer 1


According to the Form API Reference, #prefix & #suffix are valid properties of the form element, so you should be able to:

$form['#prefix'] = '<div class="some-class">';
$form['#suffix'] = '</div>';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.