You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The trick will be to add a field, or 2 fields, to the JSON output of each field, telling the fbValidateProcessJSON snippet which fields are only required if a show/hide checkbox OR radio is selected.
This is because the field_parent cannot get the contents of the [[+legend]] layout setting from it’s parent layout. By adding that value to a field inside a collapsible fieldset, and only when it is set as collapsible, then the fbValidateProcessJSON snippet can be rewritten to check that first, before generating the normal validation row.
We need to write a snippet to accomplish this, similar to the existing cbGetFieldContent snippet, to go over the layouts and check if it is a collapsible layout, and if so: get the value of the [[+legend]] field of the fieldset.
Can we do that? Or can Mark do that?
Processing the JSON output
Once finished, we need to hook up certain things in the JSON output. field_parent values in the input fields need to be matched with collapse_target of the radio button or checkbox that toggles the fieldset show/hide.
RequiredIf validation
The trick will be to add a field, or 2 fields, to the JSON output of each field, telling the fbValidateProcessJSON snippet which fields are only required if a show/hide checkbox OR radio is selected.
Right now, it’s hardcoded like this:
This is because the field_parent cannot get the contents of the [[+legend]] layout setting from it’s parent layout. By adding that value to a field inside a collapsible fieldset, and only when it is set as collapsible, then the fbValidateProcessJSON snippet can be rewritten to check that first, before generating the normal validation row.
We need to write a snippet to accomplish this, similar to the existing cbGetFieldContent snippet, to go over the layouts and check if it is a collapsible layout, and if so: get the value of the [[+legend]] field of the fieldset.
Can we do that? Or can Mark do that?
Processing the JSON output
Once finished, we need to hook up certain things in the JSON output. field_parent values in the input fields need to be matched with collapse_target of the radio button or checkbox that toggles the fieldset show/hide.
Based on the following JSON output:
Can we do something like this?
Desired output
In the end, the output should be like this:
[[prefix]]-[[field_name]]:requiredIf=^[[prefix]]-[[fieldname_of_showhide_radio]]==“[[value_of_showhide_radio]]”^,
The text was updated successfully, but these errors were encountered: