Setting a field to disabled makes the HTML-input read-only and not greyed out

Niklas6
Tera Expert

I have created a record producer in a scoped app with some variables, both select and text input fields. In an onLoad catalog client script I am setting a few of those fields, both text and select, to disabled (i.e. setDisabled(<field>, true)). 

 

The select fields are disabled and greyed out but the text fields are not greyed out but you can't write anything. Inspecting the HTML-code I can see that the select input has gotten the attribute disabled while the text fields gets readonly="readonly". As I understand setting the field to readonly makes it readonly but not greyed out and disabling it makes it greyed out as I want. 

 

When testing to create a catalog ui policy instead (and disabling the catalog client script code) the result is the same. 

 

There is no other place where I set disabled or readonly. 

 

Anyone having any clue how to fix this?

4 REPLIES 4

Ankur Bawiskar
Tera Patron

@Niklas6 

why to use setDisabled() and not use setReadOnly?

Because I want the field greyed out and I think setReadOnly doesn't provide that but setDisabled does. Right?

Any updates on this? The HTML field is not editable but not greyed out.

NagaChandaE
Mega Sage

Hi @Niklas6 ,

Can you share the images of form and script?

Just checking that variables are not mandatory. use the setReadOnly.

If you found this helpful, please mark it as Helpful and Accept as Solution