Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
With the emergence of jQuery in core, it would be extremely useful if all buttons have a proper ID associated with them. This can make it easier to add various AJAX effects, form handlers, and so forth.
Comment | File | Size | Author |
---|---|---|---|
#4 | d_11.patch | 1.2 KB | m3avrck |
#1 | d_10.patch | 1.12 KB | m3avrck |
d_9.patch | 925 bytes | m3avrck | |
Comments
Comment #1
m3avrck CreditAttribution: m3avrck commentedHere's a better patch that won't override the ID for the button if it has been set somewhere else.
Comment #2
Steven CreditAttribution: Steven commentedId's have a very restricted set of allowed characters. drupal_strtolower does not suffice. We have a form_clean_id() function, but I believe it expects name="" attribute values (i.e. only underscore, dash and brackets are removed).
Comment #3
Steven CreditAttribution: Steven commented.. and I think form API already assigns an ID automatically in #id (not #attributes > #id).
Comment #4
m3avrck CreditAttribution: m3avrck commentedSimplified after talking with Steven.
Comment #5
m3avrck CreditAttribution: m3avrck commentedComment #6
Steven CreditAttribution: Steven commentedCommitted to HEAD. Thanks.
Comment #7
(not verified) CreditAttribution: commented