Make Read-only field to Editable

Balaji Munusamy
Tera Contributor

I have a requirement to make read-only field to editable. In my form there is 2 True/False fields - Follow 1 & Follow 2. Here Follow 2 is Read Only. In my requirement if I check Follow 1 then Follow 2 should become editable. I have tried with UI policy action and script also -  g_form.setReadOnly('follow1', false) but it doesn't work.

 

Please assist me on this @Ankur Bawiskar @Community Alums 

 

1 ACCEPTED SOLUTION

Hello @Balaji Munusamy ,

You have to write two UI Policies, first one work onLoad ( without any condition ) which set the Follow2 as readyOnly.

 

Second one when Follow1 is checked ( or True ) , then "with condition Follow1 is true" set the Follow2 editable.  

AshishKMishra_1-1700060602780.png

 

AshishKMishra_0-1700060539230.png

result ( Follow2 is read only )

AshishKMishra_2-1700060709132.png

 

Thanks,

AshishKMishra

View solution in original post

10 REPLIES 10

Okay, @AshishKM  already provided the UI solution .

Hello @Balaji Munusamy ,

You have to write two UI Policies, first one work onLoad ( without any condition ) which set the Follow2 as readyOnly.

 

Second one when Follow1 is checked ( or True ) , then "with condition Follow1 is true" set the Follow2 editable.  

AshishKMishra_1-1700060602780.png

 

AshishKMishra_0-1700060539230.png

result ( Follow2 is read only )

AshishKMishra_2-1700060709132.png

 

Thanks,

AshishKMishra

Thanks @AshishKM 

It works!!

Hi @AshishKM @Dr Atul - LNG 

function onCondition() {
g_form.setReadOnly('u_follow_up_2', false);
}

Try with 2 UI Policies, as given in my previous reply. Its working on PDI

What I did :

- create two checkbox field "Follow1" and "Follow2"

- create a first UI Policy to make Follow2 readonly [ no condition ]

- create a second UI Policy to make Follow2 editable when Follow1 is checked/true.

 

-Thanks,

AshishKMishra