how to put a submit button with a pre-defined submit function by calling drupal_render? I've been search results for hours but cannot find an answer to my problem.

I want to show a list using theme("table",...); inside my table, there's a column of buttons, which each functions as deleting the record for this row. Therefore, I did something like this:

foreach($person_list as $pyid =&gt; $record){
  $render_ele = array('remove'.$pyid =&gt; array(
      '#type' =&gt; "submit",
      "#value"=&gt; "remove",
      '#submit' =&gt; array('shms_cca_form_remove_person_from_group'),
      "#limit_validation_errors"  =&gt; array(),
      "#attributes" =&gt; array("pyid" =&gt; $pyid,'action' =&gt; "remove"),
    ));
  $rows[] = array(
    $record['full_name'], // full name
    $record['matric_no'],  // matric no
    $record['room_number'], // room number
    $record['position_name'],
    is_numeric($record['cca_points'])?$record['cca_points']:"Not Assigned Yet",
    drupal_render_children($render_ele),
  );
};


However, when I clicked on the button, the submit function I've defined is not called (it called the default submit function instead).

When I try to add another default button into my form like this:

$form += array(
  'nani' =&gt; array(
    '#type' =&gt; "submit",
      "#value"=&gt; "remove",
      '#submit' =&gt; array('shms_cca_form_remove_person_from_group'),
      "#limit_validation_errors"  =&gt; array(),
  ),


Both this button and my old-not-functioning submit button works.

I therefore conclude that it's a JavaScript problem... possibly some JavaScript is not included when I call the drupal_render by myself.

Could anyone help on how to solve this problem?
Thanks a lot.

Update:
I called drupal_render, because I want to pass the rendered result to rows[] so that I can put these elements inside a table, like this:

$render_ele = array('remove'.$pyid =&gt; array(
      '#type' =&gt; "submit",
      "#value"=&gt; "remove",
      '#submit' =&gt; array('shms_cca_form_remove_person_from_group'),
      "#limit_validation_errors"  =&gt; array(),
      "#attributes" =&gt; array("pyid" =&gt; $pyid,'action' =&gt; "remove"),
    ));

$rows[] = array(
  $record['full_name'], // full name
  $record['matric_no'],  // matric no
  $record['room_number'], // room number
  drupal_render($option),
);
return array(
"person_list" =&gt; array(
  '#type' =&gt; 'fieldset',
  "#title"=&gt; t("Group Members"),
  '#collapsible'  =&gt; TRUE,
  "#collapsed"  =&gt; FALSE,
  "#children"   =&gt; theme("table",array('header'=&gt;$header,"rows"=&gt;$rows)).$add_member_str,
  '#weight'     =&gt; 10,
),


);
Are you returning those $render_elem from your form function, when drupal_get_form calls that form id callback? Because i see you call drupal_render_children, but drupal need to know about it in form of form api array. drupal_get_form expecting you return from your form_id function form api array of form elements, so it can do some operation like checking, if current request is POST and contains form_id of your form and some name of submit button.  

EDIT: Try add all submit buttons to your form array, but set their property #printed =&gt; true, so they won't be rendered, but drupal will be notified about those buttons and can run your submit functions.