How to create an event from a relation N:N?

Hello,

I created a field “doble select” with a relation N:N, however, i want to show/hide anothers textfields according to the values to select but the option of the field “doble select” doesn’t appear at the moment to create an event AJAX.

this is al old thread, but i want to do almost de same here. any help?

I have a product form where in a relation n: n where i can select different faults that may have.

example
— block 1
id: 01
Product: Display
Brand: Samsung
— block 2 (diagnostic)
type of failure: doesnt turn on (checkbox) damaged port (checkbox) scratch surface (checkbox)

status: ok / fail

the “type of failure” is brought from a table of “failures” in a n:n relationship, because in the future, and depending on the product, other failures may be added.

what I want to do is that, even if any of the failures checkbox its marked, the “status” field will go to the “fail” value. If I uncheck all the checkboxes, the “status” field need to be changed to the “ok” value.

i did a javascript function that works (for example if i placed it on a button or event in other field), but i cant reach de event “onclick” of the checkboxes where it should be.

any suggestion?