# Preceding and trailing spaces are ignored with text input

**URL:** https://discourse.nodered.org/t/preceding-and-trailing-spaces-are-ignored-with-text-input/21735
**Category:** Dashboard
**Created:** [15 February 2020 05:08 UTC](https://discourse.nodered.org/t/preceding-and-trailing-spaces-are-ignored-with-text-input/21735 "2020-02-15T05:08:00Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![AsHex\_66](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ashex_66/32/31151_2.png) [@AsHex\_66](https://discourse.nodered.org/u/AsHex_66)
#### Post date: [15 February 2020 05:08 UTC](https://discourse.nodered.org/t/preceding-and-trailing-spaces-are-ignored-with-text-input/21735/1 "2020-02-15T05:08:01Z")

</div>

All,

It appears that preceding spaces or trailing spaces are ignored in a text input.  
This becomes an issue when we do a 'password entry'  
There is also no trigger on the output when a space is entered.

Example code

```auto
[{"id":"de2de0af.b6406","type":"ui_text_input","z":"37e2c67c.85274a","name":"","label":"","tooltip":"","group":"668d9db5.aab0e4","order":2,"width":0,"height":0,"passthru":true,"mode":"text","delay":"100","topic":"","x":340,"y":280,"wires":[["17f4886.d747c78"]]},{"id":"9dbeea4a.9fd778","type":"ui_text_input","z":"37e2c67c.85274a","name":"","label":"","tooltip":"","group":"668d9db5.aab0e4","order":1,"width":0,"height":0,"passthru":true,"mode":"password","delay":"100","topic":"","x":360,"y":330,"wires":[["e86ed49d.f07ec8"]]},{"id":"17f4886.d747c78","type":"debug","z":"37e2c67c.85274a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":640,"y":280,"wires":[]},{"id":"e86ed49d.f07ec8","type":"debug","z":"37e2c67c.85274a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":640,"y":330,"wires":[]},{"id":"668d9db5.aab0e4","type":"ui_group","name":"Group 1","tab":"1cec7880.5a4688","order":1,"disp":true,"width":6},{"id":"1cec7880.5a4688","type":"ui_tab","z":"","name":"Example entry","icon":"dashboard","order":7,"disabled":false,"hidden":false}]

```

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

As you can see in above example, we entered the following  
' 3 spaces ' (Not the '')

But the payload out of the function is in both cases

```auto
{"payload":"3 spaces","socketid":"XrYwAW7CPErPnN2WAAAJ","_msgid":"434e6646.6207c8"}

```

any spaces between characters are captured.  
This causes me grief as I use the password entry and compare this with a fixed entry.  
The user thinks he entered 14 characters, but the payload only presents 8 characters.

If the entry is made only out of spaces, then no payload is delivered out of the text input function

Any way to get around this?

---

_[View the full topic](https://discourse.nodered.org/t/preceding-and-trailing-spaces-are-ignored-with-text-input/21735)._
