# Textfield validation

**URL:** <https://forum.kirupa.com/t/textfield-validation/222156>\
**Category:** flash\
**Created:** [April 11, 2007, 10:04am UTC](https://forum.kirupa.com/t/textfield-validation/222156 "2007-04-11T10:04:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RubenFlash](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@RubenFlash](https://forum.kirupa.com/u/RubenFlash)\
**Post date:** [April 11, 2007, 10:04am UTC](https://forum.kirupa.com/t/textfield-validation/222156/1 "2007-04-11T10:04:51Z")

</div>

Hello good people! 🍺

I was just wondering. Please, have a look on the following code:

```php

if(myText.text == ""){
    trace("Please, fill in some text");
}
else{
    trace("Thanks a lot dude!");
}  

```

A simple text validation, right? The problem is that, if the user hits the spacebar, it still validates. Is there any way to solve this?

Thanks!
