Change order of markup for exposed views filter I have a search box on my homepage, and to style it correctly I need the button to come before the text box in the markup. The current block code looks like the following.

&lt;form action="/drupal-7.22/search" method="get" id="views-exposed-form-commerce-search-page" accept-charset="UTF-8"&gt;&lt;div&gt;&lt;div class="views-exposed-form"&gt;
  &lt;div class="views-exposed-widgets clearfix"&gt;
          &lt;div id="edit-search-api-views-fulltext-wrapper" class="views-exposed-widget views-widget-filter-search_api_views_fulltext"&gt;
                  &lt;label for="edit-search-api-views-fulltext"&gt;
            Search for products          &lt;/label&gt;
                        &lt;div class="views-widget"&gt;
          &lt;div class="form-item form-type-textfield form-item-search-api-views-fulltext"&gt;
 &lt;input type="text" id="edit-search-api-views-fulltext" name="search_api_views_fulltext" value="" size="30" maxlength="128" class="form-text required error"&gt;
&lt;/div&gt;
        &lt;/div&gt;
              &lt;/div&gt;
                    &lt;div class="views-exposed-widget views-submit-button"&gt;
      &lt;input type="submit" id="edit-submit-commerce-search" name="" value="Go!" class="form-submit"&gt;    &lt;/div&gt;
      &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;/form&gt;


I've looked at hook_form_alter() and a few template files, but I think that's the wrong way to do it and I'm far from an expert.

I wouldn't mind being able to clean up that tangle of divs too!
You can create your own views-exposed-form.tpl.php file and move the submit button to the top, or add a class to it and use css to float left and right. This however would affect all exposed filter on your site.

If you want to alter the form you should use the function 

function MODULENAME_form_views_exposed_form_alter(&amp;$form, $form_state)


Your best option is however to try manipulating it with css.