<div class="form-type-radio form-item-field-lot-und form-item">
....
</div>

How remove this wrapper to create inline radio or checkbox labels?

Comments

anikitin35’s picture

How to remove 'controls' and 'control wrapper' from views exposed filters forms?

<div id="edit-field-price-value-wrapper" class="views-exposed-widget views-widget-filter-field_price_value">
                  <label for="edit-field-price-value">
            Price          </label>
                        <div class="views-widget">
          <div class="control-group form-type-textfield form-item-field-price-value-min form-item">
 <div class="controls"> <input type="text" id="edit-field-price-value-min" name="field_price_value[min]" value="" size="10" maxlength="20" class="form-text">
</div></div>
<div class="control-group form-type-textfield form-item-field-price-value-max form-item">
  <label for="edit-field-price-value-max" class="control-label">And </label>
<div class="controls"> <input type="text" id="edit-field-price-value-max" name="field_price_value[max]" value="" size="10" maxlength="20" class="form-text">
</div></div>
        </div>
              </div>
anikitin35’s picture

Issue summary: View changes

Code

j0rd’s picture

Title: Remove div wrapper around radios and checkboxes elements » Remove div wrapper around radios and checkboxes elements, allow for easier inline'ing.
Issue summary: View changes

I've been looking at this today. I need inline radio and checkboxes.

Currently bootstrap theme is not outputting radios and checkboxes in the proper "bootstrap html way (tm)", so with out CSS hacks, or changes in code, this really won't work.

I looked into doing it myself, but after two hours I gave up. It's quite complicated due to Drupal expanding out a "radios" or "checkboxes" type into a bunch of individual "radio" or "checkbox" fields, and not using a wrapper.

Here's the bootstrap way:
http://getbootstrap.com/css/#forms-controls (search for "inline checkboxes")

markhalliwell’s picture

Status: Active » Closed (won't fix)
Issue tags: -inline
Related issues: +#1943174: Better FAPI/Webform Support

This has been fixed in 7.x-3.x already. The 7.x-2.x branch only receives security fixes.

Also this will likely get re-evaluated even more with the related issue.

jpchristie’s picture

You can do that in jquery (adding radio-inline for bootstrap compliance):

$('.form-type-radio label').addClass('radio-inline');
$('.radio-inline').unwrap('

');
$('.form-type-checkbox label').addClass('checkbox-inline');
$('.checkbox-inline').unwrap('

');

catFighter’s picture

Only way is use this module https://www.drupal.org/project/vefl then you can create custom template for widget: views-exposed-widget.tpl.php or views-exposed-widget--NAMEYOURFILTERFIELD.tpl.php