Skip to content
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

HTML for expanded choice widgets not the best #131

Closed
pbowyer opened this issue Nov 27, 2013 · 0 comments
Closed

HTML for expanded choice widgets not the best #131

pbowyer opened this issue Nov 27, 2013 · 0 comments

Comments

@pbowyer
Copy link

pbowyer commented Nov 27, 2013

I believe I've found a bug in the markup Twig outputs for expanded choices, using block choice_widget_expanded. The generated HTML (reformatted for ease of reading) is:

  <div class="form-group">
    <label class="control-label required">Gender</label>

    <div id="application_gender">
      <div class="form-group">
        <div class="radio">
          <label for="application_gender_0" class="required"><input type="radio" id=
          "application_gender_0" name="application[gender]" required="required" value="m"
          checked="checked"> Male</label>
        </div>
      </div>

      <div class="form-group">
        <div class="radio">
          <label for="application_gender_1" class="required"><input type="radio" id=
          "application_gender_1" name="application[gender]" required="required" value=
          "f"> Female</label>
        </div>
      </div>
    </div>
  </div>

The issue? Note the extra <div class="form-group"> divs around every radio button. This causes problems with styling, as Bootstrap doesn't expect nested form groups; it also makes displaying jQuery Validation errors harder, as the structure changes for expanded choices vs single radio/checkbox markup.

I have hacked around in the Twig template, but I've only had success at breaking Twig...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant