# Perspective no blanks or spaces in text boxs

**URL:** <https://forum.inductiveautomation.com/t/perspective-no-blanks-or-spaces-in-text-boxs/44478>\
**Category:** Ignition\
**Tags:** perspective, ignition80\
**Created:** [March 15, 2021, 4:35pm UTC](https://forum.inductiveautomation.com/t/perspective-no-blanks-or-spaces-in-text-boxs/44478 "2021-03-15T16:35:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![seanbuckley2698](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@seanbuckley2698](https://forum.inductiveautomation.com/u/seanbuckley2698)\
**Post date:** [March 15, 2021, 4:35pm UTC](https://forum.inductiveautomation.com/t/perspective-no-blanks-or-spaces-in-text-boxs/44478/1 "2021-03-15T16:35:23Z")

</div>

Hi,  
I am trying to script so that my 5 text boxes do not accept blanks or spaces and when one is entered and submitted using a button, a pop up comes up. I had the blanks working but I cant find a way to stop spaces.  
All help is welcome, thanks.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [March 15, 2021, 4:38pm UTC](https://forum.inductiveautomation.com/t/perspective-no-blanks-or-spaces-in-text-boxs/44478/2 "2021-03-15T16:38:01Z")

</div>

Out of curiosity, what is the difference between a blank and a space? Do you mean like an empty string (`""`)?

---

<div class="post-metadata">

**Author:** ![seanbuckley2698](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@seanbuckley2698](https://forum.inductiveautomation.com/u/seanbuckley2698)\
**Post date:** [March 15, 2021, 4:40pm UTC](https://forum.inductiveautomation.com/t/perspective-no-blanks-or-spaces-in-text-boxs/44478/3 "2021-03-15T16:40:17Z")

</div>

blank would be ("") and space would be (" ").

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [March 15, 2021, 4:44pm UTC](https://forum.inductiveautomation.com/t/perspective-no-blanks-or-spaces-in-text-boxs/44478/4 "2021-03-15T16:44:44Z")

</div>

So something like this:

```auto
text_value_one = self.getSibling('TextField').props.text
if (len(text_value_one) == 0) or (text_value_one == " "):
    # popup

```

or looping through multiple fields:

```auto
all_inputs = []
all_inputs.append(self.getSibling('TextField').props.text)
...
all_inputs.append(self.getSibling('TextField_4').props.text)
for value in all_inputs:
    if (len(value) == 0) or (value == " "):
        # popup

```

Unless you don’t want a space allowed as part of the input, at which point you want `in`:

```auto
text_value_one = self.getSibling('TextField').props.text
if (len(text_value_one) == 0) or (" " in text_value_one):
    # popup

```

---

<div class="post-metadata">

**Author:** ![seanbuckley2698](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@seanbuckley2698](https://forum.inductiveautomation.com/u/seanbuckley2698)\
**Post date:** [March 15, 2021, 6:11pm UTC](https://forum.inductiveautomation.com/t/perspective-no-blanks-or-spaces-in-text-boxs/44478/5 "2021-03-15T18:11:26Z")

</div>

Worked out there, thanks for the help
