8000 Symfony 2.8.11 - Form `choice`'s options are inheriting id and name of parent select · Issue #19898 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Symfony 2.8.11 - Form choice's options are inheriting id and name of parent select #19898

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

Closed
alanhartless opened this issue Sep 9, 2016 · 3 comments

Comments

@alanhartless
Copy link

I had an override for choice_widget_options.html.php as a work around for #19016. I noticed that has since been fixed so wanted to give it a try. When I removed the override to use stock, I noticed that each option of the select inherited it's id and name attributes as well. This caused issues for me with JS getElementById(). Should a check be in place to not set the parent's id and name?

@alanhartless
Copy link
Author

Actually both lines 1 and 2 - if the select is disabled, it adds disabled to all options making it impossible to get the fixed value via JS. https://github.com/symfony/symfony/blob/2.8/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_attributes.html.php#L1-L2

@HeahDude
Copy link
Contributor

Thanks @alanhartless for reporting this, indeed this line should be removed. See #19904.

Status: reviewed

fabpot added a commit that referenced this issue Sep 14, 2016
…Dude)

This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Fixed collapsed ChoiceType options attributes

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #19898
| License       | MIT
| Doc PR        | ~

Commits
-------

7806e2a Fixed collapsed ChoiceType options attributes
@fabpot fabpot closed this as completed Sep 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
0