By half_brick on
Hi all,
I'm themeing a form that contains two select elements and a submit button, and I want to position the Submit at the top of the form so that I can float the two selects right so that the form will appear as (right aligned):
rather than
So I try doing this in my form's theme function:
function theme_my_form($form){
$output .= '<div class="float-right" >' . drupal_render($form) . '</div>';
$output .= '<div class="float-right" >' . drupal_render($form['first_select']) . '</div>';
$output .= '<div class="float-right" >' . drupal_render($form['first_select']) . '</div>';
return $output;
}
But that doesn't really work, as the first line just spits out the whole form.
So two questions, what is the voodoo behind the call to drupal_render($form)? And can I replace it with something that just spits out the Submit button or form element etc?
Cheers,
Toby
Comments
Solved my own problem
Solved my own problem. I just put:
I'd still like to more about why the
line is necessary though...
in case you didn't get an
in case you didn't get an answer to your question yet, this is an excerpt from the forms api quickstart documentation: