Element javascript doesn't work onload in details view when element not shown

Jaanus

Super Moderator
When I set elements (usually yesno) to hide other elements or whole groups using javascript feature then
in details view it works only when this element is shown.

In example I create a special group named "Setting" and there I have some yesnos that I use to hide or show one or another element/group. Let's say there are settings on how to display a personal data. One yesno button is named "Alive?" and if "yes" then the date field "Deceased" is hidden. Of course it doesn't make any sense to show the settings data to public - so I set this group to be shown in form view only. But when I go then to the details view then all elements that the yesnos made hidden in form view are shown (i.e. the empty "Deceased" element).

The same happens with single javascript elements as well. If they are visible in details view then every element that should be hidden onload are hidden. But should I set their access in details view to "Nobody" the "hidden" fields are shown.

Assuming that the access setting for elements are not the same that the option "hidden" (or "yes, but hidden" for groups) - would there be a solution if we could determine whether the element is "hidden" only in form, only in details or both?
 
If the element's acl stops it from being loaded into the form, then it makes sense to me that is js code is also not loaded.
We can't assign data that the user is not allowed to use/see to the page as that represents a security risk, so for your scenario I think you would need to write a custom details template to handle things
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top