# How to use node status to display error for empty input

**URL:** <https://discourse.nodered.org/t/how-to-use-node-status-to-display-error-for-empty-input/74113>\
**Category:** Developing Nodes\
**Created:** [24 January 2023 10:22 UTC](https://discourse.nodered.org/t/how-to-use-node-status-to-display-error-for-empty-input/74113 "2023-01-24T10:22:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![syedhannan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/syedhannan/32/72932_2.png) [@syedhannan](https://discourse.nodered.org/u/syedhannan)\
**Post date:** [24 January 2023 10:22 UTC](https://discourse.nodered.org/t/how-to-use-node-status-to-display-error-for-empty-input/74113/1 "2023-01-24T10:22:22Z")

</div>

I wanted to know how to add the node status if any of text input in the editor is blank.

Got this code from docs but not sure how to use it in the html file.

```auto
this.status({fill:"red",shape:"ring",text:"disconnected"});

```

---

<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:** [24 January 2023 10:33 UTC](https://discourse.nodered.org/t/how-to-use-node-status-to-display-error-for-empty-input/74113/2 "2023-01-24T10:33:38Z")

</div>

> [@syedhannan](#):
>
> Got this code from docs but not sure how to use it in the html file.
> 
> ```auto
> this.status({fill:"red",shape:"ring",text:"disconnected"});
> 
> ```

`status(...)` is a server side thing and is only valid for deployed nodes.

Once a user deploys your node, you will know if any fields are blank by checking what was sent in the config - then you can call `.status`

For the HTML side, you use[validators](https://nodered.org/docs/creating-nodes/properties#property-validation) on the field.

---

<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:** [7 February 2023 10:34 UTC](https://discourse.nodered.org/t/how-to-use-node-status-to-display-error-for-empty-input/74113/3 "2023-02-07T10:34:32Z")

</div>

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