textfield with #disabled = true, #input = false A textfield with #disabled = TRUE will appear greyed out, and be unchangeable.

A textfield with #input = FALSE will not send its value to $form_state['values'], and will be ignored by system_settings_form_submit().

Unfortunately, a textfield with #disabled = TRUE and #input = FALSE no longer appears greyed out.

I want to make a textfield that is purely for display purposes, so a person can copy a value from there. What is the best way to do this?

EDIT I: What I tried so far

To clarify, my starting point is code like this:

$form['thetext'] = [
  '#type' =&gt; 'textfield',
  '#title' =&gt; t('The text'),
  '#disabled' =&gt; true,  // This should make it greyed out - but it doesn't due to #input = false below.
  '#input' =&gt; false,  // This should make this field ignored in $form_state['values'].
  '#value' =&gt; 'xyz',  // Either #value or #default_value.
];


EDIT II:

If this wasn't clear before: I really want the html output to be a textfield element. I also want to use the regular form + theme API, so that the element gets a label and wrapper div and theming like other form elements in the same form. E.g. if I would just hardcode the textfield html, it would no longer have the same classes, wrappers etc.
Use a markup element instead.

$form['element'] = array(
    '#type' =&gt; 'markup',
    '#markup' =&gt; 'This is the thing you want people to see. You can use &lt;strong&gt;html&lt;/strong&gt;, too.',
);


You don't actually have to specify #type =&gt; 'markup' because drupal defaults to that type if you don't specify, but I do anyway as it seems to be good practice.