hook_form_alter() exposed filter form item #weight I'm trying to insert a form element with hook_form_alter(), and then rearrange the form elements so that the new form item appears at a particular point amongst the existing exposed filters.

I've tried adding #weight of 0 to all existing items and then #weight of -1 to the new element, just to see if I can have any influence on the form item order at all, however I don't seem to be able to affect it.

EDIT: In addition I'm getting kinda weird behaviour regarding the container of the Form element. I'm adding my form element as a new array element at the root of $form, however it is be rendered inside the element &lt;div class="views-exposed-widget views-submit-button"&gt; rather than getting it's own container, which seems like either a bug or I really am doing something wrong!
Take a look at comments #3, #7 and #9  in http://drupal.org/node/893392

#3 (dereine):


  The problem is that there is some theming on exposed form. You would have to override it, sadly.


#7 (manatwo):


  Yes, all of it is handled in views-exposed-form.tpl.php, which you can override in your theme to print out your fields manually. IIRC, the extra fields are gonna be in the $button variable in that template, so you might want to do some preprocessing in template.php


#9 (PadreHomer):


  I was able to alter the order without overriding the template. I am using Views 3, but I think this will work in Views 2 as well.
  
  Alter the order of the filters in $form['#info'] in your form_alter and this should alter the order the widgets print out in the template without having to do any custom templating.