There are lots of links to #submit (submit_property) but it's not in the FAPI doc.

Additional issue: The example used for #submit in #button_type is wrong.

$type['submit'] = array(
  '#input' => TRUE,
  '#name' => 'op',
  '#button_type' => 'submit',
  '#submit' => TRUE,
);
CommentFileSizeAuthor
#3 drupal.870276.patch3.29 KBjgraham

Comments

rfay’s picture

Assigned: Unassigned » rfay
jhodgdon’s picture

Project: Documentation » Drupal core
Version: » 7.x-dev
Component: Correction/Clarification » documentation

Wrong issue queue.

jgraham’s picture

StatusFileSize
new3.29 KB

Attached is a patch which addresses the submit_property issue.

I'm not positive on the update to the 'button_type' example addresses the issue so please take a closer look at that section.

jgraham’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, drupal.870276.patch, failed testing.

jgraham’s picture

Status: Needs work » Needs review

Inline summary of the patch.

button_type example fix:

$types['submit'] = array(<br />
  '#input' => TRUE,<br />
  '#name' => 'op',<br />
  '#button_type' => 'submit',<br />
  '#executes_submit_callback' => TRUE,<br />
  '#limit_validation_errors' => FALSE,<br />
  '#process' => array('ajax_process_form'),<br />
  '#theme_wrappers' => array('button'),<br />
);

#submit fix:

#submit

Used by: button, image_button, submit, form

Description:  A list of custom submit functions that will be called when the element is submitted. This is usually to add additional submit functions to a form, or to use an alternate function rather than the default form validation function which is the form ID with _submit appended to it.

Values: An array of function names. Each such function will take $form and $form_state as parameters.

Usage example (node_form()):

  if (!empty($node->nid) && node_access('delete', $node)) {
    $form['actions']['delete'] = array(
      '#type' => 'submit',
      '#value' => t('Delete'),
      '#weight' => 15,
      '#submit' => array('node_form_delete_submit'),
    );
rfay’s picture

Status: Needs review » Reviewed & tested by the community

Looks like the ticket to me.

dries’s picture

#3: drupal.870276.patch queued for re-testing.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, drupal.870276.patch, failed testing.

rfay’s picture

@Dries - this is just a docs patch. Nobody has objected to it so @jgraham will commit it soon. But the bot doesn't know what to do with it :-)

rfay’s picture

Issue tags: +FAPI reference

New tag for these issues: FAPI reference

rfay’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)
Issue tags: -FAPI reference

Automatically closed -- issue fixed for 2 weeks with no activity.