Adding custom form to form_alter -- help please I've been trying for awhile to add a custom form to a custom module so as to make it show in drupal profile Edit page. Using the normal $form['submit'] messes up the other forms in the page, so tried to use $form['#submit'][] and append the second submit handler, but still no luck. Hoping someone can see what i am doing wrong.

Here is the code i have so far:

function custom_module_form_alter(&amp;$form, &amp;$form_state, $form_id) {
 if ($form_id == 'user_profile_form' &amp;&amp; user_access('delete mods', $form['#user'])) {

$modlist = getcurrentmods(); // this function returns an array of usernames

$form['modlist']['mods'] = array(
'#type'=&gt;'select',
'#options' =&gt; $modlist,
'#multiple' =&gt; false,
'#weight' =&gt; 30,
'#size' =&gt; 10,
'#id' =&gt; 'modlist',
'#prefix' =&gt; '&lt;div id="dropdown-modlist"&gt;',
'#suffix' =&gt; '&lt;/div&gt;',
 );

$form['#submit'][] = array(
'#type' =&gt; 'submit',
'#value' =&gt; t('Delete'),
'#submit' =&gt; array('_modlist_delete_callback'),
'#weight' =&gt; 32,
'#attributes' =&gt; array(
    'class' =&gt; array('submit-inline'),
),
'#ajax' =&gt; array('callback' =&gt; '_modlist_delete_callback',
'wrapper' =&gt; 'dropdown-modlist',
'effect' =&gt; 'fade',
'method' =&gt; 'replace',
  ),
 );

  }
}


The dropdown with the user list shows up fine, however the submit button doesn't.
Anything with a # preceding it isn't an element, it's a property. Properties are not rendered.

To fix, just give your submit button a unique key without the #, e.g.

$form['foo_submit'] = array(
  '#type' =&gt; 'submit',
  ...
);