g_form.setDisplay(' ',false) is not working for onLoad Client script

Sri63
Mega Expert

I am trying to hide a field through onLoad. But setDisplay functionality is not working 

 

find_real_file.png

1 ACCEPTED SOLUTION

Brian Lancaster
Tera Sage

If you want to hide a filed you should be using g_form.setVisible(name, visibility).

g_form.setVisible('u_ct_app', false);

View solution in original post

7 REPLIES 7

Jaspal Singh
Mega Patron
Mega Patron

Hi Srini,

 

Few quick options.

 

1. Change the UI Type to Both

2. Use below snippet

var ctvalueis=g_form.getValue('u_ct');
alert('CT Value is '+ctvalueis);

if(ctvalue!='Config')
{
alert('Successfully validated the if condition');
g_form.setDisplayValue('u_ct_app',false);
}

 

Comment the alert conditions if all works well.

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

nope not working 

Harsh Vardhan
Giga Patron

are you sure the condition which you have used that is working ?

and this kind of requirement can be easily done by Catalog UI Policy , i would suggest go through UI Policy.

 

now coming back to setDisplay() , it works might be you are missing something in your script. as other folks already suggested you to add alert() in your catalog client script so are you getting alert pop up ? put the alert('hey if') inside the if block