Hide form section based on field is empty.

Kruthik M Shiva
Tera Contributor

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.

function onLoad() {
   //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.setVisible('iav_ipod', false);
 
}
 
 if (mv==' '){
 
    g_form.setVisible('mv_ipod', false);
 
}
}
6 REPLIES 6

if mandatory fields are not field then it will not hide? 

 

Yes it will not hide if the section has mandatory variables which are not filled, it is platform behavior. you need to fill all mandatory fields or you need to set those fields non - mandatory then you can hide section

Regards
Harish