hook_form_alter add field after submit button to exposed view I'm trying to add a field that would be displayed after the submit button in the rendered HTML in my hook_form_alter.
e.g.
$form['include_card'] = [
  '#type' =&gt; 'checkbox',
  '#title' =&gt; t('Include gift card'),
  '#weight' =&gt; 25,
];  

Weight doesn't seem to have any bearing on it.  How would you set that up?
The submit button will likely be inside an Actions element, which has a default weight of 100.
You could add your field to the actions element:
$form['actions']['include_card'] = ...

At which point the weight of include_card will be relative to the buttons/etc that are inside the actions element (and 25 will probably work).
Another option would be to position your element directly after the actions:
$form['include_card'] = [
  '#type' =&gt; 'checkbox',
  '#title' =&gt; t('Include gift card'),
  '#weight' =&gt; $form['actions']['#weight'] + 1,
];