I have two form elements on a node form I'm trying to order unsuccessfully. One is a standard collection of form buttons (submit, delete, etc) and another is a fieldset add by CCK. I am trying to order the submit button (one of the buttons in the collection) above the fieldset. I've set the #weight on the button collection (the parent form element of the submit) to a number lower than the #weight of the fieldset.

I've verified that after the #pre_render calls in drupal_render() the weight values I set earlier in my hook_form_alter persist. So nothing has changed them up to this point. I can confirm that changing the weight on the fieldset does it move it around, so I am having some impact on positioning.

Why does FAPI ignore the weights and still position the submit button at the bottom of the form? Or is there another point after drupal_render() that allows other modules to change form element weights?

1 Answer 1


I've discovered this is expected behavior. The solution is to copy the buttons into new form elements, position them where desired, and remove the default buttons. Here are step by step instructions on how to do this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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