New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dev.icinga.com #5967] Automatically submitting form elements can cause a controller to process the form #565
Comments
Updated by tgelf on 2014-04-17 16:39:16 +00:00 They should be able to distinct this based on button values. Expected behaviour:
Forms/controllers should make their decisions based on the button chosen by this rules. If JS doesn't perform like this, the bug lies there. Regards, |
Updated by jmeyer on 2014-04-30 11:16:25 +00:00
|
Updated by jmeyer on 2014-04-30 11:57:41 +00:00
|
Updated by mjentsch on 2014-05-28 16:29:01 +00:00 This issue is probably caused by our enableAutoSubmit function in our Form class. It will simply add the JavaScript $(this.form).submit(); and does not use the class autosubmit, which is intended for that purpose. |
Updated by elippmann on 2014-06-01 12:23:19 +00:00
|
Updated by mhein on 2014-06-02 13:43:00 +00:00
|
Updated by mhein on 2014-06-03 11:00:46 +00:00
|
Updated by tgelf on 2014-06-20 12:40:03 +00:00
Applied in changeset icingaweb2|916c9c027e78bdbfbafd4b484412c4dcd37ec068. |
Updated by jmeyer on 2014-06-23 07:07:36 +00:00
This is not fully fixed. Select boxes can still cause the controller to process the forms data. (e.g. general configuration, preference type, don't store preferences) |
Updated by tgelf on 2014-06-23 07:27:37 +00:00
Try to set a submit label:
Unfortunately forms lack basic understanding of how HTML forms really work. You only know whether a button has been pressed by checking it's value. If it has a label but the form doesn't know about that's "unfortunate". Setting the above in your form's create method should fix your form, letting base form "know" it's default label would be "slightly" better. Best, |
Updated by tgelf on 2014-06-23 11:35:04 +00:00
Applied in changeset icingaweb2|ba9a633b735905fe319fbc439aa8e818b58a82e8. |
Updated by jmeyer on 2014-08-12 08:17:44 +00:00
|
This issue has been migrated from Redmine: https://dev.icinga.com/issues/5967
Created by jmeyer on 2014-04-08 12:01:33 +00:00
Assignee: tgelf
Status: Resolved (closed on 2014-06-23 11:35:04 +00:00)
Target Version: 2.0-6
Last Update: 2014-06-23 11:35:04 +00:00 (in Redmine)
An element that is auto-submitting its form causes a usual POST/GET being made. A controller cannot differentiate automatic or manual submits. The only distinction made is whether the form's data is valid or not. This is fine as long as there are missing entries in the form, but once all entries are made and an auto-submitting form element is changed, the controller processes the form's data.
Example form: Preferences
Changesets
2014-06-20 12:32:22 +00:00 by tgelf 916c9c0
2014-06-23 11:31:34 +00:00 by tgelf ba9a633
2014-06-23 13:46:15 +00:00 by tgelf 1efd1d1
Relations:
The text was updated successfully, but these errors were encountered: