This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

Daniel81
Daniel81

Does anyone know how to do this as using disabled: true in the fields.yaml doesn't seem to work? Maybe this is a bug that needs reporting?

Daniel81
Daniel81

I have temporarily managed this with some javascript in the controller, but would like to know if the disabled property is actually working

d.negativa
d.negativa

Hi! Unfortunately the documentation made ​​a mistake! I also tried to understand why it is not working. After careful consideration of some plugins, I found that you need to add "attributes" and put there "disabled"


fields:
    campaign:
      label: Campaign
      attributes:
        disabled: true

Last updated

Daniel81
Daniel81

Thanks @d.negativa

digdaya.np4106
digdaya.np4106

Thanks a lot d.negativa .. That is very important information!

wilirius15434
wilirius15434

Also note that in the FormField this looks like this:

$field->attributes['fields']['disabled' => true];

To disable, setting to false will not work. It has to be removed completely, as this is just the way the disabled attribute currently works.

Also setting disabled does not work for some types of fields (field widgets).

Last updated

Meysam
Meysam

Why don't you use readOnly?

fields:
    title:
        label: Title
        span: auto
        readOnly: true

1-7 of 7

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.