# Form node: making a text value read only

**URL:** <https://discourse.nodered.org/t/form-node-making-a-text-value-read-only/90813>\
**Category:** Dashboard\
**Tags:** node-red-dashboard, dashboard-2\
**Created:** [9 September 2024 13:00 UTC](https://discourse.nodered.org/t/form-node-making-a-text-value-read-only/90813 "2024-09-09T13:00:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Potemkin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/potemkin/32/94325_2.png) [@Potemkin](https://discourse.nodered.org/u/Potemkin)\
**Post date:** [9 September 2024 13:00 UTC](https://discourse.nodered.org/t/form-node-making-a-text-value-read-only/90813/1 "2024-09-09T13:00:42Z")

</div>

Hi Guys,  
I have a form the user needs to input, but the first value on the form is a "transaction ID". This is a database generated unique value and though I want it to be displayed, I don't want the user to edit it. I haven't found a readonly attribute in the form config itself, so instead I pass msg.ui\_update.options through a change node. It works fine, except for the readonly part. Here is the first few (pertinent) lines of the msg object:

```auto
    {
        "type": "text",
        "label": "Transaction No",
        "key": "txNum",
        "required": true,
        "readonly": true
    },
    {
        "type": "date",
        "label": "Date",
        "key": "txDate",
        "required": false
    },
    {
        "type": "time",
        "label": "Time",
        "key": "txTime",
        "required": false
    },
    {
        "type": "text",
        "label": "License Plate",
        "key": "txPlate",
        "required": false
    }

```

Changing the readonly attribute does nothing - I'm sure my error is going to be something elementary that I'm overlooking - any ideas?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [9 September 2024 13:34 UTC](https://discourse.nodered.org/t/form-node-making-a-text-value-read-only/90813/2 "2024-09-09T13:34:49Z")

</div>

From the [docs](https://dashboard.flowfuse.com/nodes/widgets/ui-form.html) readonly/disabled field support does not appear to be an option.

This is not an unreasonable request or use case.

You can raise a feature request here: [Sign in to GitHub · GitHub](https://github.com/FlowFuse/node-red-dashboard/issues/new/choose) - the developers are open to suggestions 🙂

---

<div class="post-metadata">

**Author:** ![omrid](https://avatars.discourse-cdn.com/v4/letter/o/77aa72/32.png) [@omrid](https://discourse.nodered.org/u/omrid)\
**Post date:** [9 September 2024 14:29 UTC](https://discourse.nodered.org/t/form-node-making-a-text-value-read-only/90813/3 "2024-09-09T14:29:34Z")

</div>

Indeed this is a worthy feature request.  
For the time being, you can define this field as a read-only HTML tag in a template node, or a Markdown node (populated with `{{...}}` ). Will require an extra step in extracting & inserting it into the form 'submit' msg

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [9 September 2024 16:17 UTC](https://discourse.nodered.org/t/form-node-making-a-text-value-read-only/90813/4 "2024-09-09T16:17:35Z")

</div>

Could you use the Label field?

---

<div class="post-metadata">

**Author:** ![Potemkin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/potemkin/32/94325_2.png) [@Potemkin](https://discourse.nodered.org/u/Potemkin)\
**Post date:** [9 September 2024 16:33 UTC](https://discourse.nodered.org/t/form-node-making-a-text-value-read-only/90813/5 "2024-09-09T16:33:55Z")

</div>

Thanks for the super fast responses.  
@Colin - Using the label field is a pretty good idea, though I'm not sure I can achieve the "slick" look with it.  
@omrid - Thanks for the suggestion.  
Seems I'm going to go with a separate Text output - pretty obvious workaround though ideally I wanted to retain the data in the form object as I thought this might be more elegant.  
But after 2 aspirins and a short break I'll just go this way 😉

---

<div class="post-metadata">

**Author:** ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)\
**Post date:** [10 September 2024 09:56 UTC](https://discourse.nodered.org/t/form-node-making-a-text-value-read-only/90813/6 "2024-09-10T09:56:56Z")

</div>

Please do open a [Feature Request](https://github.com/FlowFuse/node-red-dashboard/issues/new/choose) for this, would be a very valuable addition.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [10 October 2024 09:57 UTC](https://discourse.nodered.org/t/form-node-making-a-text-value-read-only/90813/7 "2024-10-10T09:57:02Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
