Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
documentation
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
18 Jul 2010 at 17:44 UTC
Updated:
5 Nov 2010 at 18:30 UTC
Jump to comment: Most recent file
It turns out there's been a #ajax['keypress'] in there forever. It needs to be added to the Form API reference. There also may be code changes that should be added to document this.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 857702.patch | 1.57 KB | jgraham |
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
darren oh#ajax['keypress'] = TRUE causes the element's #ajax['event'] to be triggered if the Enter key is pressed while the element has focus.
Another important setting is #ajax['trigger_as']. This should contain an array with a 'name' key and an optional 'value' key. This allows non-button elements to submit the form as if a button had been clicked. The 'name' key specifies the button to trigger, and the 'value' key is required if more than one button shares the same name. (Documented in code comments of ajax_process_form().)
Comment #2
rfayComment #3
rfayI added #ajax['keypress'] to the D7 FAPI. Review is appreciated, http://api.drupal.org/api/drupal/developer--topics--forms_api_reference....
I'll leave this open because we should copy this to D6, but I'm out of gas for right now.
Comment #4
jhodgdonWrong issue queue
Comment #5
jgraham commentedAttached is a patch that covers the D6 details, I assumed they are equivalent to the D7 ajax event of the same name.
#ahah['keypress']
Description: If set to TRUE, then the element's #ahah['event'] will be triggered if the ENTER key is pressed while the element has focus.
Comment #6
rfayAs far as I can tell, these were in fact the same in D6. Thanks.
Comment #7
jgraham commentedComment #8
rfayThanks!