Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By DAKSH on
I'm writing my first module. And in the form drupal adds form-item form-type- for every item.
I was looking for a solution and find out this solution from stackoverflow
Couldn't understand much from api page
The answer works fine for one input item not for entire form.
So, if I don't want any wrapper at all, how could I remove them?
Comments
To what end?
To what end?
For every select, input box,
For every select, input box, drupal is adding div class="form-item form-type-select form-item-chartSize"
I would would prefer to have no div class wrapper at all.
I understand that. I just don
I understand that. I just don't understand why.
You can probably loop through every form element in a form_alter hook, and remove them there.
Work Around
I found a work around mostly.
If I use $form['email']['#theme_wrappers'] = array(); for each item separately, I'm able to remove wrappers mostly except radio.
I'm trying to use Jqueryui Radiobuttonset without using any additional module.
For Radio my module code is
However drupal is producing wrappers for each options and using $form['email']['#theme_wrappers'] = array() isn't helping in case of radio.
Html looks like:
Any suggestion on it?