Hello there
is it possible to make a specific section of a form only visible if a checkbox is checked? I think it might be possible via AddItem script? For example, I want the section "Materials Managements" to be only visible if the Checkbox "Materials Managements" is also checked. I attached my PDF, can anyone help?
Kind regards
MrWilson
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
You can include an if statement in the click event of the checkbox. This will look at the value of the checkfield (1 = on; 2 = off). Then depending on the value it will make the associated subform either visible or hidden (excluded from the layout). I have wrapped each section in its own subform (positioned) which makes it easier to reference.
if (this.rawValue == 1)
{
flowedSubform.materialsManagement.presence = "visible";
}
else
{
flowedSubform.materialsManagement.presence = "hidden";
}
Taking this further, you can wrap all three subforms in a flowed subform and save the file as dynamic. This way if a subform is hidden, the remaining subforms will take up the space.
Hope that helps,
Niall
Views
Replies
Total Likes
Hi,
You can include an if statement in the click event of the checkbox. This will look at the value of the checkfield (1 = on; 2 = off). Then depending on the value it will make the associated subform either visible or hidden (excluded from the layout). I have wrapped each section in its own subform (positioned) which makes it easier to reference.
if (this.rawValue == 1)
{
flowedSubform.materialsManagement.presence = "visible";
}
else
{
flowedSubform.materialsManagement.presence = "hidden";
}
Taking this further, you can wrap all three subforms in a flowed subform and save the file as dynamic. This way if a subform is hidden, the remaining subforms will take up the space.
Hope that helps,
Niall
Views
Replies
Total Likes
Thank you very much, that was exactly what I was looking for!
Kind regards
MrWilson
Views
Replies
Total Likes