Hello
I am using fieldset in order to wrap field elements
If I add a fieldset, it will add the name of the fieldset in the ID and it will break my previous css.

If you have a fieldset that wraps other fieldsets, you get an incredibly long ID. I don't know why the module is adding his parent key in the ID

I think it would be better to use field key to generate a class for this element.

I have seen a patch in order to add css class and it might be the right way to do it but It may be easier to catch the key of the field and create a simple css class with it

Thanks

Comments

quicksketch’s picture

Title: Automatic css class » Disable the use of IDs on fieldsets
Status: Active » Closed (won't fix)

The ID needs to be unique, and so the keys are concatenated together. Field keys are not actually unique, they can be reused as long as they have different parents or pages.

#2059215: Replace use of IDs to classes on Webform wrappers to avoid duplicate IDs
#776690: Multiple forms: Unique edit-submit ID on submit button

In later versions, these IDs are required for conditionals to work correctly. So in general, I don't think there's a way you should be able to remove these IDs anyway, since their required for functionality. We might switch these to classes in #2059215: Replace use of IDs to classes on Webform wrappers to avoid duplicate IDs, but the general situation that these IDs are required stands.