Javascript onchange readonly all fields in group not working

procajlok

Member
Hi!
I have simple Javascript onchange action on calc element:
upload_2022-7-14_12-50-14.png

When i choose particullary fields it's working, but on group - not. When i choose hide or show action - that work. Is there any chance to take action to all fields in group? I have up to 15 fields to readonly (if calc =1) or not readonly (if calc !=1) - for me it's 30 rows to code.

Or maybe you would be so kind as to give me the appropriate code to do it in one item by JS code? :(
 
Not sure if this could be your solution, but let's see:
By default, Fabrik group elements are wrapped into fieldsets. So, with a tiny little custom JS you should be able to set the relevant group's fieldset to disabled (or not) depending on the calc element's value. See e.g. https://stackoverflow.com/questions...-an-entire-html-form-readonly#answer-17186342

Alternatively, if you insist on readonly (or not), and with hardly any more lines of custom JS, you can do so as well, of course. You just need to get the selector(s) right. Without seeing the form, it's not simple to tell you the selector(s), of course, if that's a mystery to you.
Either way, and just in case, note that not all form field types can be set readonly.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top