- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2018 12:28 PM
Hi Team,
I want to hide form sections based on the condition. we have created 2 form sections, both the form sections has certain fields, and fields with mandatory too. Now, when i try to hide the form section using g_form.setSectionDisplay('<form section name>', false), it is not hiding the form section.
If all the mandatory fields are filled in that section and tried to hide than it is successful, but why its not hiding when it has mandatory fields. I have made fields mandatory via UI Policy.
Appreciate your inputs.
Thanks,
Lohith
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2018 12:47 PM
Yes, this is the expected behaviour. g_form.setSectionDisplay('<form section name>', false), will check whether is there any fields are mandatory, before hiding it.
Before hiding the section in the client script, you have to make the fields in the section as g_form.setMandatory('field_name', false); for all the fields in the section and then you have to add g_form.setSectionDisplay('section name', false); it will work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2018 12:48 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2018 12:55 PM
Can u paste the copy of your script here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2018 01:17 AM
I used UI Policy to hide and show Form section based on the condition, wrote script to show form section when condition satisfies and when condition fails to hide the form section. It is working fine as expected even if mandatory fields are present in form section its hiding the form section.
g_form.setSectionDisplay('section name', true); to show form section
g_form.setSectionDisplay('section name', false); it hide form section

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2022 04:59 AM - edited 02-07-2024 01:58 AM
g_form.setSectionDisplay('schedule', false);
The first parameter is simply the name of your section, which should be completely lower-case.
Sections including spaces should use an underscore in place of the first space with the rest of the spaces removed.
For example, a form section with a label of ‘Schedule and Planning’ would require a parameter of ‘schedule_andplanning’. The second parameter is a true/false boolean that indicates whether the form section should be visible or not.