-
Notifications
You must be signed in to change notification settings - Fork 51
Review all submit buttons to include both name and value attributes #1502
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
Comments
Actually, I'm no longer sure it works for |
So the HTML specs says the label is always the value for |
This patch seems to do the trick and leaves everything else working as it were: diff --git a/BrainPortal/app/helpers/dynamic_form_helper.rb b/BrainPortal/app/helpers/dynamic_form_helper.rb
index 238580ebe..50cf2958f 100644
--- a/BrainPortal/app/helpers/dynamic_form_helper.rb
+++ b/BrainPortal/app/helpers/dynamic_form_helper.rb
@@ -264,7 +264,7 @@ module DynamicFormHelper
options["data-associated-form"] = form_id
- submit_tag(name, options)
+ button_tag(name, options.merge(:form => form_id, :type => 'text'))
end
# Creates a disabled checkbox, which will be checked if |
Work on this issue should wait until the PR for the new control channels if merged, because many buttons were already adjusted there. |
Done by commit d3c8f45 |
I don't think it's done. There are still buttons to adjust. |
I think the only remaming page was in the Signups index page, which is admin only. I'll commit a change right now. It's simple, I tested it and it works. |
There is still one use in the neuro plugins. I will fix it there. |
For reference, the signups page fix is at 6b5b70e |
Fixed in the neuro plugins too. |
For historical reasons, we still have a bunch of buttons that trigger actions where the actions makes a decision based on the button's visible label.
E.g.
submit_tag()
that can be found inapp/view/signups/_signups_table.html.erb
external_submit_button
found inapp/view/background_activities/_background_activity_table.html.erb
This doesn't work well when people use browser extensions that translate the content of our pages, because the translated buttons now send the wrong values.
We can fix this quite simply by reviewing all these buttons and adding both a name and a value attribute to the tags (or maybe just value if the name is the default 'commit').
I already verified that
external_submit_button()
supports them both.The text was updated successfully, but these errors were encountered: