Survey fields cannot be made read-only

tgoulart
Tera Contributor

I'm unable to make certain survey fields read-only when they are accessed, as I do not want the client to change certain metadata fields that are just meant to be informative. Is there are a way to make certain fields read-only on the surveys?

3 REPLIES 3

Its_Azar
Tera Guru

Hey there @tgoulart 

 

I guess you can make the feild readonly, let me help you.

you can write a client script that runs on the onload event of the form. Within this script, you can use JavaScript to target the specific fields you want to make read-only and disable them.

 

function makeFieldsReadOnly() {
    g_form.setReadOnly('field_name', true); // Replace 'field_name' with the actual name of your field
 
}

 

You can use UI Policiesu to set field attributes dynamically based on conditions. You can create a UI Policy that sets the read-only attribute to true for the fields you want to lock down. Then, apply this policy to the form.

 

If this helps kindly accept the response thanks much

Regards

Azar

☑️ If this helped, please mark it as Helpful or Accept Solution so others can find the answer too.




Kind Regards,

Mohamed Azarudeen Z

Developer @ KPMG

 Microsoft MVP (AI Services), India

Sumanth16
Kilo Patron

Hi @tgoulart ,

 

If you have created the survey using the survey designer then there is already configuration available in the survey designer itself for making a field read only

 

Go to asmt_metric table:-

 

Sumanth16_0-1710088786972.png

 

 

If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,

Sumanth Meda

 

Hi @Sumanth16,

 

Unfortunately this feature does not work. All fields I've marked as read-only remain editable for the end user while filling the survey