How to use multiple submit within a CTools Modal I'm using a CTools modal to add a holiday. The topside of that form in the modal displays the already defined holidays with an "X" that will allow you to delete a holiday. I have created a submit button for each that is put in a table with this code (the rows are rendered in a table afterwards).

foreach ($locationVO-&gt;Holidays as $holiday) {
    $fid = 'delete' . $holiday['id'];
    $form['holidays'][$fid] =
            array(
                '#name' =&gt; 'delete_' . $holiday['id'],
                '#type' =&gt; 'image_button',
                '#src' =&gt; $crossimg,
                '#attributes' =&gt; array('class' =&gt; array('delete_holiday')),
                '#return_value' =&gt; $holiday['id']
    );
   $field = drupal_render($form['holidays'][$fid]);

   $rows[] = array($holiday['name'], ISOdate2DutchDate($holiday['from']), ISOdate2DutchDate($holiday['to']), $field);
  }


Everything is rendered ok, but if I try to delete a holiday, the triggering_element and the clicked_button arrays in form_state still always refer to the main submit that I defined in the CTools form_info array. I therefor cannot distinguish between the submits for adding and deleting.

What do I need to do to get my triggering_element to correspond with the selected submit? I also tried specifying a separate '#submit' handler for the delete buttons, but that is never called either. 

Other solutions are welcome as well, as long a I can do it without closing/leaving the modal (I already tried with a link to a separate delete handler which worked up until the referral back to the modal). 

Thanks!
Never figured out how to do this, but I worked around the problem by using CTools functionality. In a nutshell I used ctools_ajax_image_button in the table, specified a specific callback for the url and then alter the table with ajax_command_remove, ajax_command_restripe and finally returning it with ajax_render.

This is all based on the CTools AJAX example that deletes rows from a table.