Hide form section based on field is empty.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2023 12:11 AM
Hi All,
I have a requirement like hiding form section based on one of the fields is empty. I have created on load client script, but it is not working anyone help me on this what is the issue, and anything need to be changed in my script.
PFB script I used in clientscript.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2023 12:20 AM
Hello @Kruthik M Shiva
Do you want to show/hide section on the form or just fields on the form? in your script you are hiding the fields.
If it is the fields, you can simply create one UI policy with required condition and set field visibility to false.
If you want to hide section display, then you will need to use g_form.setSectionDisplay() function. To know your section name, you can write below alert message in your onload script alert(g_form.getSectionNames());
Thank you,
Ali
Thank you,
Ali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2023 12:29 AM
Hi @Ahmmed Ali ,
I tried it's not working; can you please tell what needs to be changed in my script.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2023 01:52 AM
What is the field/s name and what is the section name?
Thank you,
Ali

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2023 12:40 AM
Hi you need to use below method to hide section. If there are any mandatory fields not filled, section will not hide
//Type appropriate comment here, and begin script below
var iav1=g_form.getValue('iav');
var mv=g_form.getValue('module_name');
if (iav1==' ')
{
g_form.setSectionDisplay('iav_ipod', false);
}
if (mv==' '){
g_form.setSectionDisplay('iav_ipod', false);
}
Harish