Ajax button in list to delete row entry - submit function is called instead of callback I have a themed table on a form. To delete entries in this table I render buttons for each row having a special idx and an ajax callback for each button.

The buttons are rendered perfectly, but when I click on the button, the standard submit routine is called instead of the assigned callback routine. Is there anything I missed?

// build header for table
$pheader = array('Name','Action');
// build data array for table
$aPersonsTable = array();
foreach ($aPersons as $key =&gt; $value) {
  $form_button['button'.$key] = array(
    '#id' =&gt; 'del-p-'.$key,
    '#name' =&gt; 'del-p-'.$key,
    '#idx' =&gt; $key,
    '#type' =&gt; 'submit',
    '#value' =&gt; 'Delete',
    '#submit' =&gt; 'delete_auction_person_ajax_callback_submit',
    '#attributes' =&gt; array('class'=&gt;array('ajax-processed')),
    '#ajax' =&gt; array(
      'callback' =&gt; 'delete_auction_person_ajax_callback',
      'progress' =&gt; array('type' =&gt; 'none'),
      'effect' =&gt; 'fade',
    )
  );
  $deleteButton = drupal_render($form_button['button'.$key]);
  $row = array($value['dname'],$deleteButton);
  $aPersonsTable[]=$row;
}

$form['persons']['ptable'] = array(
  '#theme' =&gt; 'table',
  '#header' =&gt; $pheader,
  '#rows' =&gt; isset($aPersonsTable)?$aPersonsTable:null,
  '#disabled' =&gt; TRUE,
  '#title' =&gt; 'Users currently assigned',
  '#empty' =&gt; t('No users assigned yet!'),
  '#prefix' =&gt; '&lt;div id="ptable_wrapper"&gt;',
  '#suffix' =&gt; '&lt;/div&gt;',
);
Remove the '#submit' =&gt; 'delete_auction_person_ajax_callback_submit', it does not seem necessary. Adding ajax-processed class on the button doesn't seem necessary either. The function delete_auction_person_ajax_callback receives $form and $form_state, and will tell you what input was clicked that triggered the callback, from there you can do whatever it is you need to do.

I built a lot of tables this way, but I don't think I had the form items as a submit type. If I recall, I used buttons.