NO BUG: Bricks Forms Field ID not followed

In v1-11-1 - I made bricks forms with conditional fields. After upgrading to v1-12-1, when you look at the assigned id to the form fields in the form module they are still the same when it was created in v1-11-1, but the rendered id in the front end change each reload causing my js to fail. There is no other way to target the field group since the id is assigned dynamically.

Had to downgrade back to v1-11-1 for the form to work again.

Hi @jayguntor,

The ID has been dynamic for a long time now, including v1-11-1. Could you please share a URL to your form in 1.11.1? maybe I’m missing something.

The input’s name property on the other hand is static (doesn’t change).

Sorry for not being clear. Here is the screenshot of the checkbox field id:
image
To target the form group with CSS, I refer to it as div[aria-labelledby=“label-bsiayq”], which works fine for v1-11-1. The name attribute is not in the parent, so I can not use it.

For v1-12-1, this id does not change in the form builder, but it is dynamically changed in the rendered output which caused my jquery script to break. So, this is what I mean the field ID not being followed.

Why would I target the form-group? because if I happen to have a long list of checkboxes, I can:

  1. enclose it in a bordered bounding box
  2. limit the bounding box to a height and assign overflow css

This feature works before; so, I don’t know if this was removed intentionally or a bug.

You should not rely on form field input id or form group aria-labelledby. Those will randomly change, mostly on each reload and is not bind/tally with the field id.

You should use the hook to output the field id as attribute to form group or input filed.

It is counter productive to write a code just to output id to the form group. Here is what I used instead since I need to fix up my forms (CSS):

.brxe-form .form-group:has(.options-wrapper) { /* Checkbox group */ }

The problem with this approach is when Bricks Builder decides to change the element names.

Hello @jayguntor,

thank you for the additional information. Yes, we changed the behavior recently about how we generate the checkbox IDs, but this was a mandatory change, because previously, if you duplicated the form with checkbox or radio fields, the field IDs were duplicated.
Same happened if you had a form inside the template, and you inserted the template multiple times.

That’s why I’ll mark it as a no-bug, because it works as intended.

Best regards,
Matej