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(&$form, &$form_state, $form_id) {
if ($form_id == 'user_profile_form' && user_access('delete mods', $form['#user'])) {
$modlist = getcurrentmods(); // this function returns an array of usernames
$form['modlist']['mods'] = array(
'#type'=>'select',
'#options' => $modlist,
'#multiple' => false,
'#weight' => 30,
'#size' => 10,
'#id' => 'modlist',
'#prefix' => '<div id="dropdown-modlist">',
'#suffix' => '</div>',
);
$form['#submit'][] = array(
'#type' => 'submit',
'#value' => t('Delete'),
'#submit' => array('_modlist_delete_callback'),
'#weight' => 32,
'#attributes' => array(
'class' => array('submit-inline'),
),
'#ajax' => array('callback' => '_modlist_delete_callback',
'wrapper' => 'dropdown-modlist',
'effect' => 'fade',
'method' => 'replace',
),
);
}
}
The dropdown with the user list shows up fine, however the submit button doesn't.