Closed (outdated)
Project:
Drupal core
Version:
9.5.x-dev
Component:
forms system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 May 2011 at 13:01 UTC
Updated:
21 Jun 2023 at 17:46 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
damien tournoud commentedTry disabling Javascript and you will see that the behavior remains the same.
It's a browser issue, and a very messy one. HTML5 has some nothing to say on this issue:
"May", "May pick another", ...
Comment #2
amitaibuSo you say we should change the variable name to "#it-might-be-the-triggering_element" ? ;)
Comment #3
damien tournoud commentedIt is the triggering element alright. It's just that each browser have a different notion of what is the default button associated with a text field.
Comment #4
amitaibuThe problem that I had with it, was when I wanted to use #limit_validation_errors. So in the end I gave all the submit buttons the same #limit_validation_errors so it will validate only what is really needed.
I guess this issue should be about writing a patch to document the fact that #triggering_element is browser specific.
Comment #5
amitaibuLittle docs about this.
Comment #6
rfayThis has been brought up before, and I *think* it's a general web-wide problem with browsers not being consistent. I've fought with it quite a lot (I hate the performance settings page because I always hit enter to submit, and it clears the cache instead of saving my settings.)
I suppose we could do something about this with javascript, but not sure there's a general solution. However, I'm certainly not a wise one in this area.
Comment #7
amitaibuA bit better docs.
Comment #8
rfayHmm. $form_state['clicked_button'] is obsolete ($form_state['triggering_element'] has replaced it. So in 8.x we should remove 'clicked_button' completely from the doc.
Moving this to 8.x since it has to be done there first.
I don't have an objection to documenting this in the AJAX stuff (I don't think) but I don't think this problem has anything to do with Drupal.
Comment #9
amitaibu> I don't think this problem has anything to do with Drupal.
I agree it's not a Drupal bug, but still I think a line or two can help people understand why their form isn't submitted as they might expect.
Comment #10
rfayComment #11
amitaibu@rfay,
Your comment on #10 is empty?
Comment #12
amitaibu#7: 1153960-trigger-element-7.patch queued for re-testing.
Comment #14
Everett Zufelt commented+ * and is also used in Ajax handlers. Note that the value of the triggering
+ * element after a user pressed the enter key is browser specific, as the HTML
+ * does not specify clear enough which element should be selected as the
Note that the value of the triggering element after a user presses the enter key is browser specific, as HTML does not provide a mechanism to specify which button to use as the triggering element.
Comment #27
smustgrave commentedTested on safari, chrome, and firefox and not seeing any issue with the states.
If still a valid task please reopen updating issue summary to reflect D10
Thanks!