# FR: Give context to RED.validators.typedInput

**URL:** https://discourse.nodered.org/t/fr-give-context-to-red-validators-typedinput/82943
**Category:** Feature Requests
**Tags:** editor, typedinput
**Created:** [16 November 2023 19:52 UTC](https://discourse.nodered.org/t/fr-give-context-to-red-validators-typedinput/82943 "2023-11-16T19:52:48Z")
**Posts on this page:** 3
**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: [16 November 2023 19:52 UTC](https://discourse.nodered.org/t/fr-give-context-to-red-validators-typedinput/82943/1 "2023-11-16T19:52:48Z")

</div>

Hi team,

Would it be possible to give a context to `RED.validators.typedInput`?

I would like to validate inputs in a container with typedInput validator but for now it's not possible because the global context is used and without having to create my own typedInput validator 😅 (which is just a copy)

Just change

```js
$("#node-"+(isConfig?"config-":"")+"input-"+ptypeName).val()

```

by

```js
$(this).find("#node-"+(isConfig?"config-":"")+"input-"+ptypeName).val()

```

> <https://github.com/node-red/node-red/blob/c6a8eee73d337841dcbf6df7819d033f6de4b649/packages/node_modules/%40node-red/editor-client/src/js/validators.js#L45>

---

<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: [22 November 2023 17:20 UTC](https://discourse.nodered.org/t/fr-give-context-to-red-validators-typedinput/82943/2 "2023-11-22T17:20:47Z")

</div>

A new `type` option has been added ([#4440](https://github.com/node-red/node-red/pull/4440)) and allows to statically define the type of the field. Which simplifies the idea of the context because in the end the field only has one type which is accessible when the validator is called. So I close as resolved 🙂

---

<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: [21 January 2024 17:21 UTC](https://discourse.nodered.org/t/fr-give-context-to-red-validators-typedinput/82943/3 "2024-01-21T17:21:27Z")

</div>

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