Make auto populated field read-only

Srikanth Menava
Kilo Sage

Hi Community Folks,

I have a catalog form with 10 reference fields(from sys_user), I am using a script include a client script to get value based on the selected users, Now if 5 fields have data then have to be read-only and 5 fields doesn't have data, they have to be editable.

We have taken this approach because, user are editing the auto populated data, we don't want them to edit that. Is there a way I can do?

TIA

1 ACCEPTED SOLUTION

Aman Kumar S
Kilo Patron

Hey,

If you are using client script to autopopulate, why don't you include a check in the same to check if the response for a particular field is not empty, then set the value and also make it read only.

for eg:

if(answer != ''){
    g_form("field_name", answer);
    g_form.setReadOnly("field_name", true);
}

Best Regards
Aman Kumar

View solution in original post

2 REPLIES 2

Aman Kumar S
Kilo Patron

Hey,

If you are using client script to autopopulate, why don't you include a check in the same to check if the response for a particular field is not empty, then set the value and also make it read only.

for eg:

if(answer != ''){
    g_form("field_name", answer);
    g_form.setReadOnly("field_name", true);
}

Best Regards
Aman Kumar

Yousaf
Giga Sage

Hi ,

Please refer to this 

Making a reference variable in Service Catalog read only.

 

Mark Correct or Helpful if it helps.


***Mark Correct or Helpful if it helps.***