This setting was added by #684846: AJAX triggered by non-submit element fails if any elements are validated. It is an array that provides a 'name' and an optional 'value' (for the case when different buttons have the same 'name', such as "op" or "submit"). These should be the same #name and #value info the of the element that triggers the form submission. #name encodes the parents of the element in it, the same as form_set_error(), i.e. "level1][level2][element", though this is dependent on the value of #tree.

Comments

rfay’s picture

Assigned: Unassigned » rfay

Thanks for the report on this. I'll try to get it in there.

Do you have a use case or some example code I can refer to? I didn't even know about this one. And I worked hard on that issue :-)

rfay’s picture

Assigned: rfay » Unassigned
Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

anrikun’s picture

Status: Closed (fixed) » Active

I'm reopening this because the way #ajax['trigger_as'] is documented is absolutely not enough.
I've been scratching my head for hours trying to get it work, with no success.

jhodgdon’s picture

Project: Drupal core » Documentation
Version: 7.x-dev »
Component: documentation » API documentation files
Issue tags: +FAPI reference

Form API reference is in the Documentation git repository, so moving this issue there.

avpaderno’s picture

Title: #ajax['trigger_as'] is undocumented » Improve the documentation for #ajax['trigger_as']
Category: Bug report » Task
Issue summary: View changes
quietone’s picture

Status: Active » Closed (won't fix)

This is for the Drupal 7 Form API reference. Since Drupal 7 is past end-of-life this is now a "won't fix".
Work on documentation for form elements for supported versions of Drupal is at #2486967: [meta] Move/Create Form Element Documentation and #3313535: [Meta] Improve documentation for Render and Form Elements.

avpaderno’s picture