I’m trying to insert divs (or any tag) in my exposed filter form with the purpose of grouping related fields together. I want to have something like this:
<div class="my-group"> field one field two ... </div>
So far, I have tried this in my hook_form_alter()
, with no luck, since the prefix and sufix are added within field_one, instead of before field one and after field two:
$form['field_one']['#prefix'] = '<div class="my-group">'; $form['field_two']['#suffix'] = '</div>';
How can I accomplish this (without external modules)?