UI Policy for a field in a form when set to Visible= 'false'

Madhava_Kumar
Mega Guru

After creating a UI Policy and set a field as visible='false' is not displayed in the form. Totally agreed and working fine.

But when we inspect the field above or below that particular field and change the type="text" or remove the type, then that field is visible.

Now any one can give the value to that particular field which should be visible='false' according the UI Policy.

Here anyone can inspect and give the value what the user wants to give. Is their a better way for Hiding the form field?

1 ACCEPTED SOLUTION

Madhava_Kumar
Mega Guru

hi all,


thanks for valuable information. I got the answer for my question. cheers



thanks


Madhava


View solution in original post

7 REPLIES 7

harishdasari
Tera Guru

Hi Madhava,



Yes You can hide a field using the client script. UI policy is better way rather than writing a client script when comes to hiding a field or making it mandatory or Readonly. If still you want to hide a field you do it using client script. You need to write a IF ELSE condition based upon your requirement.



g_form.setDisplayValue('fieldname', false);



Thanks, Hope this is helpful.


Hi Harish,



I don't think setDisplayValue function works on the client side. It is aerver side function. For client side we have g_form.setValue('fieldname', false);



@Madhava... No need to worry about the source code. Users are not allowed to edit the source code. Just go for UI Policy. It will work perfectly fine till the form is dead (R.I.P form )




Thanks,


Arnab


Hi Arnab,



Thanks for correcting me.



Madhav you can use this in client side.



this is the correct g_form.setDisplay('fieldname', True/false);



Thanks


fkhan
Kilo Guru

Hi Madhaba,



you can use either setVisible(fieldName, boolean) or setDisplay(fieldName, boolean) in client script but as Arnab mentioned use of ui policy is best practice for that perpose.


Thanks,


Farukh