# Show validation results

**URL:** https://discourse.nodered.org/t/show-validation-results/36358
**Category:** Core Development
**Created:** [22 November 2020 20:47 UTC](https://discourse.nodered.org/t/show-validation-results/36358 "2020-11-22T20:47:13Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [22 November 2020 22:54 UTC](https://discourse.nodered.org/t/show-validation-results/36358/5 "2020-11-22T22:54:11Z")

</div>

> [@BartButenaers](#):
>
> So then I only need to have (somehow?) a red border...

Currently I validate the value of the TypedInput myself, for example:

```auto
var typedInputValue = val.typedInput("value");
if (!/^some_regex_for_email/i.test(typedInputValue)) {
   // Invalid email address
}

```

And then I would have to apply the red border myself.

I do it currently like that because I'm not sure how the TypedInput could do the validation on its own, when I would call the [validate](https://nodered.org/docs/api/ui/typedInput/#methods-validate) function of the TypedInput.  
Because when I set a `pattern` attribute on the TypedInput, it gets lost. For example:

```auto
$('<input type="text" pattern="some_regex_for_email">').typedInput(typedInput);

```

I could create a PR for a new 'pattern' function on the TypedInput (identical to how @Steve-Mcl did it for the [disabled](https://discourse.nodered.org/t/readonly-typedinput/35358/4) attribute). However - besides the `pattern` attribute - the html input contains quite a number of [attributes](https://www.w3schools.com/html/html_form_attributes.asp), so not sure whether it is wise/advised to add them all to the TypedInput widget (especially since the attributes differ per value type).

So not sure what is the best way to validate the TypedInput, and get a red border around it...  
Any tips are appreciated!

---

_[View the full topic](https://discourse.nodered.org/t/show-validation-results/36358)._
