Form input not being disabled In the plugin I'm creating I've got a form that has inputs which are set as disabled if they are overridden in a conifg file.

The problem that is occurring is that disabled class is added to the input but the disabled attribute is not.

This is what I've got:

{% import "_includes/forms" as forms %}    
{% set configSettings = craft.config.get('settings', 'myPlugin') %}
{% for paramKey, paramValue in array %}
       {% set disabled = (configSettings[paramKey] is defined) %}
       {# other variable sets here #}
       {{ forms.textField({
            label: paramLabel,
            name: inputName,
            value : paramValue,
            disabled: disabled,
            required: required
            }) }}

{% endfor %}


When I navigate to the page, the input field is greyed out but I can still input data to the input field.

This is the HTML that I see when I inspect the element:

&lt;input class="text disabled fullwidth" type="text" name="settings[abcd]" value="abc" autocomplete="off"&gt;


I tried disabled: true and disabled: 1 in the code above to test and the same html is returned.
I copied your markup, setting and name and label manually and it added the disabled property if I used disabled: true

{{ forms.textField({
label: 'Example Label',
name: 'Example Name',
value : 'Example Value',
disabled: true,
required: true
}) }}




Perhaps you could try manually defining the field (as I did) without reading from the variables and confirm that it works.

If that fails, I suggest you enable dev mode and then use twig's dump() function to check that you don't have any errors and that the field is given correct values.

Is there anything in your log file?