How set select options attribute to readonly from json data ?

How set select options attribute to readonly from json data ?

magnus@greatlord.commagnus@greatlord.com Posts: 16Questions: 6Answers: 0

Hi
I trying set one or more option field to readonly
I have try follow json struct for a options value

{
"label": "unset",
"value": "-1",
"attr": {
"readonly": "true"
}
},

even
{
"label": "unset",
"value": "-1",
"attr": "readonly": "true"
},

None of them work to set a select option to readonly
accroding https://editor.datatables.net/reference/field/select
the attr should be supported seen version 1.6.2

How to solv this ?

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,598
    Answer ✓

    readonly, AFAIK, is for input elements, so for select data types, you need to use disabled, something like this.

    Hope that helps,

    Colin

  • magnus@greatlord.commagnus@greatlord.com Posts: 16Questions: 6Answers: 0
    edited December 2019

    Thanks I did mix it up :)
    I did change readonly to disabled it work prefect

This discussion has been closed.