I'm trying to remove a pesky div from within a multistep form I'm trying to customize with a theme. The problem is it's throwing off my css. I'm unwilling to change all my css rules without first knowing a valid reason for this div's existence.
For all my other themed forms this div, strangely, doesn't appear. The only significant difference is this form is multistep. I'm using code based on the example here. I've posted some of the code below.
function theme_mymodule_add_child_wizard($variables)
{
$form = $variables['form'];
$output .= '<div class="_'.$form['fname']['#ui_size'].'">';
$output .= drupal_render($form['fname']);
$output .= '</div>';
$output .= drupal_render_children($form);
return $output;
}
function hook_theme()
{
return array
(
'mymodule_add_child_wizard' => array
(
'render element' => 'form'
),
);
}
My goal is to convert this:
<form>//My Drupal 7 Form
<div>//Pesky Div
<input></input>//Form elements contained by Pesky Div
</div>
</form>
Into this:
<form>
<input></input>//Form elements free from Pesky Div
</form>
Just for testing purposes, I tried to change line 3842 in the core form.inc file to forcibly remove the div, but it didn't work that way. I don't actually want to change any of the core file, I'd rather find a way to override it within my module.
#Tried removing the <div> tag seen here.
return '<form' . drupal_attributes($element['#attributes']) . '><div>' . $element['#children'] . '</div></form>';