Current output:

<div class="form-item form-type-checkbox form-item-field-some-field-name-und-0-field-remove-item">
 <input type="checkbox" id="edit-field-some-field-name-und-0-field-remove-item" name="field_some_field_name[und][0][field_remove_item]" value="1" class="form-checkbox ajax-processed"> <span class="field-suffix">Remove</span>
</div>

The outer <div> could really use an additional class like "form-item-remove-item-checkbox" so that we can style these, especially since they're default display doesn't necessarily work well alongside the fields they're removing.

Comments

charlie-s’s picture

Something as simple as adding a #prefix and #suffix to the $element in field_remove_item_field_widget_form_alter() does the trick for me:

<?php
'#prefix' => '<div class="field-remove-item-wrapper">',
'#suffix' => '</div>',
?>

but it might be best to add a single class to this element's wrapper, and I don't know how to target a form element's wrapper without implementing custom theme functions for an element type. In this case that's 'checkbox' and I would think it overkill to change the type of this element to "field_remove_item_checkbox" and implement a custom theming function.

pcambra’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)

Marking this as a dupe of #2242823: Add unique css class to Remove Button as the widget is now a button.