I would like the user to only be able to enter alphanumeric characters into my editbox.
There is a function called Editbox::setValidationString(), I'm not sure exactly what this does, but perhaps it is what I am looking for?
Accepting input into editbox...
Moderators: CEGUI MVP, CEGUI Team
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Re: Accepting input into editbox...
that function allows you to set a regular expression to be used for validating the user-entered text.
This means that you can practically do any kind of validation you wish. Given that you know regular expressions.
In your case, you can do it like this:
This means that you can practically do any kind of validation you wish. Given that you know regular expressions.
In your case, you can do it like this:
Code: Select all
editbox->setValidationString("[0-9a-zA-Z]*");
Re: Accepting input into editbox...
Thank you lindquist for the quick response. Since I'm not familair with regular expressions (but I can figure out what 0-9a-zA-z are ) what is the '*' for?
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Re: Accepting input into editbox...
I have a tendency to forget the details of regualar expressions very fast. But a page I usually use when in doubt is this: http://virtual.park.uga.edu/humcomp/perl/regex2a.html
the star * means that the character just to its left may be repeated any number of times (including zero).
the star * means that the character just to its left may be repeated any number of times (including zero).
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 6 guests