# Number input type

**URL:** <https://www.ruby-forum.com/t/number-input-type/150084>\
**Category:** wxRuby\
**Created:** [October 3, 2008, 12:12pm UTC](https://www.ruby-forum.com/t/number-input-type/150084 "2008-10-03T12:12:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![biospank](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f475e1/32.png) [@biospank](https://www.ruby-forum.com/u/biospank)\
**Post date:** [October 3, 2008, 12:12pm UTC](https://www.ruby-forum.com/t/number-input-type/150084/1 "2008-10-03T12:12:27Z")

</div>

Hi all,  
is there any option to limit input type (wxTextCtrl) to accept only  
number?

thanks,

regards.

bio.

---

<div class="post-metadata">

**Author:** ![biospank](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f475e1/32.png) [@biospank](https://www.ruby-forum.com/u/biospank)\
**Post date:** [October 3, 2008, 12:24pm UTC](https://www.ruby-forum.com/t/number-input-type/150084/2 "2008-10-03T12:24:49Z")

</div>

hi

Fabio P. wrote:

> is there any option to limit input type (wxTextCtrl) to accept only  
> number?

```
tx = Wx::TextCtrl.new(self)
tx.validator = Wx::TextValidator.new(Wx::FILTER_NUMERIC)

```

cheers  
alex

---

<div class="post-metadata">

**Author:** ![biospank](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f475e1/32.png) [@biospank](https://www.ruby-forum.com/u/biospank)\
**Post date:** [October 3, 2008, 1:26pm UTC](https://www.ruby-forum.com/t/number-input-type/150084/3 "2008-10-03T13:26:23Z")

</div>

Too fast!!

thank you Alex. 🙂

bio.
