# \[Proposal\] Add validation tooltip message to ALL fields

**URL:** <https://discourse.nodered.org/t/proposal-add-validation-tooltip-message-to-all-fields/83229>\
**Category:** Feature Requests\
**Tags:** editor\
**Created:** [27 November 2023 18:49 UTC](https://discourse.nodered.org/t/proposal-add-validation-tooltip-message-to-all-fields/83229 "2023-11-27T18:49:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [27 November 2023 18:49 UTC](https://discourse.nodered.org/t/proposal-add-validation-tooltip-message-to-all-fields/83229/1 "2023-11-27T18:49:13Z")

</div>

Hi team,

When an input is invalid, the field turns red but we can go further... Only certain entries have a tooltip that appears to show the error to the user which is more practical than "invalid field".

 ![Capture d’écran 2023-11-27 à 19.37.51](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/a/9a1d6019e91b3b32627eca623e426f53d643141d.png)

Unfortunately, as I said, there are only a few entries that use it and I want to fix it.

There are two ways to trigger a tooltip:

1. **From node properties**

Currently only inputs NOT builded with typedInput support tooltip.  
I added support for inputs built with typedInput in [#4449](https://github.com/node-red/node-red/pull/4449) and took the opportunity to add a tooltip to the field type (`typeField`) in [#4450](https://github.com/node-red/node-red/pull/4450).

1. **From jQuery**

All that's left is built-in jQuery support to use the tooltip in a container like the `inject` node.

**Are you interested**?

@knolleary, regarding backwards compatibility, I just have to be careful to return a boolean for `.typedInput("validate")` method?

Thank you all for your feedback 🙂

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [27 November 2023 19:08 UTC](https://discourse.nodered.org/t/proposal-add-validation-tooltip-message-to-all-fields/83229/2 "2023-11-27T19:08:44Z")

</div>

Do those messages get pulled from the message catalogue ? I.E. are they i18n translatable ?

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [27 November 2023 19:15 UTC](https://discourse.nodered.org/t/proposal-add-validation-tooltip-message-to-all-fields/83229/3 "2023-11-27T19:15:56Z")

</div>

Yes, the principle of validation does not change, it is entirely possible to use i18n in the `validate` function.

For the default validation functions (e.g. msg) the node-red catalog will be used

I use this kind of function for my nodes:

 ![Capture d’écran 2023-11-27 à 20.11.43](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/4/f448c655177904bc03b20ff55b01c83c293c3302.png)

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [29 November 2023 18:06 UTC](https://discourse.nodered.org/t/proposal-add-validation-tooltip-message-to-all-fields/83229/4 "2023-11-29T18:06:08Z")

</div>

@knolleary, @dceejay,  
To generate the tooltip there are two possibilities:

1. In typedInput `validate` and the returned value is a boolean
2. In `validateNodeEditorProperty` but the `validate` function (PR#4455) must return a string

The advantage of the second is that it's centralized, the disadvantage is for backward compatibility. What is the best approach?

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [12 December 2023 16:24 UTC](https://discourse.nodered.org/t/proposal-add-validation-tooltip-message-to-all-fields/83229/5 "2023-12-12T16:24:52Z")

</div>

Hi Team,  
Made some progress on the tooltip validation message - [Add tooltip input validation msg · GogoVega/node-red@ba08cf0 · GitHub](https://github.com/GogoVega/node-red/commit/ba08cf041765189d1b915fff245590c804863291)

Last remaining is to translate the errors created by `normalizePropertyExpression`, how do we do it?

---

<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 February 2024 16:25 UTC](https://discourse.nodered.org/t/proposal-add-validation-tooltip-message-to-all-fields/83229/6 "2024-02-10T16:25:05Z")

</div>

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