I have a #process function that does something like:

function process($element, $edit)
{
   $element['#tree'] = TRUE;
   ...
   $element[0]['delete'] = array('#type' => 'button', '#value' =>
         t('Delete'));
   ...
   $element[1]['delete'] = array('#type' => 'button', '#value' =>
         t('Delete'));
   ...
   return $element;
}

Expected behavior:

$edit contains some kind of indication of which button was pressed (since using $_POST has been deprecated: http://drupal.org/node/64279#post_op)

Actual behavior:

$edit only contains the values of the other form elements

Comments

Wesley Tanaka’s picture

Assigned: Unassigned » Wesley Tanaka
Category: bug » support

I think my code might be missing something.

Wesley Tanaka’s picture

Assigned: Wesley Tanaka » Unassigned
Category: support » bug

I added a '#name' to the buttons, and they do indeed show up in $_POST, but not in $edit

Please do let me know if this isn't the correct way to define buttons.

tstoeckler’s picture

Status: Active » Closed (cannot reproduce)

Closing this issue. It's not clear what the problem is. #process functions have nothing to with a submitted button. And the linked upgrade docs show how access to the name of the pressed button in form-related functions.