# Dashboard Text Input Node - Send value on focus leave

**URL:** https://discourse.nodered.org/t/dashboard-text-input-node-send-value-on-focus-leave/61816
**Category:** Dashboard
**Created:** [26 April 2022 20:27 UTC](https://discourse.nodered.org/t/dashboard-text-input-node-send-value-on-focus-leave/61816 "2022-04-26T20:27:25Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![dudleyjosh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dudleyjosh/32/105799_2.png) [@dudleyjosh](https://discourse.nodered.org/u/dudleyjosh)
#### Post date: [26 April 2022 20:27 UTC](https://discourse.nodered.org/t/dashboard-text-input-node-send-value-on-focus-leave/61816/1 "2022-04-26T20:27:26Z")

</div>

Continuing the discussion from [Dashboard Text Input node focus issues](https://discourse.nodered.org/t/dashboard-text-input-node-focus-issues/58884):

I just ran into this very same issue (text input node doesn't always send message on focus leave) today... and I have the same issue with trying to re-create it as quoted below.

> [@Dashboard Text Input node focus issues](https://discourse.nodered.org/t/dashboard-text-input-node-focus-issues/58884/3):
>
> I tried, but the problem is that it does not happen every time. If I try to do a simple flow for testing with only one text input node, it works and the value is sent whenever I change focus (click outside the field, for instance).
> 
> When I test it on the whole thing, sometimes it will work fine, but mostly doesn't. It is very strange.

---

<div class="post-metadata">

### Author: ![OriolFM](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/oriolfm/32/30710_2.png) [@OriolFM](https://discourse.nodered.org/u/OriolFM)
#### Post date: [27 April 2022 12:51 UTC](https://discourse.nodered.org/t/dashboard-text-input-node-send-value-on-focus-leave/61816/2 "2022-04-27T12:51:25Z")

</div>

Glad to know I'm not the only one suffering from this issue. Hopefully someone can help us find why (and how to fix it).

---

<div class="post-metadata">

### Author: ![dudleyjosh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dudleyjosh/32/105799_2.png) [@dudleyjosh](https://discourse.nodered.org/u/dudleyjosh)
#### Post date: [28 April 2022 14:54 UTC](https://discourse.nodered.org/t/dashboard-text-input-node-send-value-on-focus-leave/61816/3 "2022-04-28T14:54:24Z")

</div>

Here are some screen shots of the dashboard UI that I am having this issue with.

 ![FOBA UI Markup](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/c/6cefe72a906c261a01518fb8d504360ceda99fad.png)

The text input fields boxed in yellow are the ones where I experience this issue. I originally had all of the fields set to a Delay of "0" because nothing needs to be continuously updated as it is being entered. After dealing with the issue, I changed all of the input fields in the "Marking Text" section to the default "300" to ensure they get updated when data is changed/entered. I needed to leave the three fields in the "Marking Parameters" section set to "0" however because as-is I get error messages as the numbers are entered because I am using a "Change node" with JSONata to cast those text fields as numbers after they are typed in (I understand that I can set those input fields to "number" mode but there is a specific reason I have them set to "text input").

As I am writing this up and closely looking at screen shots, I am now thinking the issue as something to do with the message at the bottom of the text input window that states...

`Setting Delay to 0 waits for Enter or Tab key, to send input.`

 ![Textline_1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/b/2b45898d72096605a1110e3dc59ac80167672705.png)

I am now thinking this means that it ignores the "Send value on focus leave" checkbox and ONLY sends with an Enter or Tab key press.

I would prefer it not ignore that checkbox and ALSO send on focus leave, but this is my best guess as to why it is behaving this way.

I quickly looked at the code for the `ui_text_input` node on GitHub and perhaps this line is what drives this behavior?

![text-input](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/a/9aebeb032aae1bb777672bf2a95fd7492ff79b1d.png)

---

<div class="post-metadata">

### Author: ![OriolFM](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/oriolfm/32/30710_2.png) [@OriolFM](https://discourse.nodered.org/u/OriolFM)
#### Post date: [28 April 2022 15:11 UTC](https://discourse.nodered.org/t/dashboard-text-input-node-send-value-on-focus-leave/61816/4 "2022-04-28T15:11:17Z")

</div>

I had all of my text input with delay 0.

My process is that I wait for the field to be complete, then when the focus leaves or I press enter, I update the JSON and push it to a MySQL DB not to lose the data.

Updating every n milliseconds would generate way too many queries and slow down the application.

---

<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: [28 May 2022 15:12 UTC](https://discourse.nodered.org/t/dashboard-text-input-node-send-value-on-focus-leave/61816/5 "2022-05-28T15:12:06Z")

</div>

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