How can I make a text box accept only uppercase letters and numbers, like H254658 or G65511, without accepting only numbers or only uppercase letters?

plise help
How can I make a text box accept only uppercase letters and numbers, like H254658 or G65511, without accepting only numbers or only uppercase letters?

Force letters to after typed to

upcase

Returns a copy of its text string argument converted to all upper case.

and checking for numerals perhaps using

contains any

Returns true if any of the pieces in the piece list appear in text; otherwise, returns false.

This block can be obtained by changing the dropdown on the contains block.

and using the appropriate If.. statements , see Programming Your App to Make Decisions for help.

how can i use it please

What have you tried?

Here are some things you can do to ensure the text entered into the TextBox meets certain criteria. using if..then statements. Make it do what you want it to do.

If you are clever you probably can use a Clock to poll the contents of the TextBox as the user types and make the TextBox self correcting as the user enters characters. I do not have an example. There might be an example in one of these links which is the result of a community search using the terms TextBox and Clock :wink: .

Someone might be able to help you with that or you can use these resources to help you learn to use the AI2 tools. A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook App Inventor 2 Book: Create Your Own Android Apps ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.

There is a free programming course here Course In A Box and the aia files for the projects in the book are here: App Inventor 2 Book: Create Your Own Android Apps

How to do a lot of basic things with App Inventor are described here: How do you...? .

Also look here App inventor español. Offline. Tutorial. Ejemplos. Instalación. Códigos. Juegos. Curso gratis de App inventor. and here Bot Verification for more tutorials

Learn about components Component Reference
and visit the Library The MIT App Inventor Library: Documentation & Support Help>Library on the MENU

An easier solution would be to accept any letter and after text input use the upcase block to convert it to the desired format

Taifun

thank you so much i will try

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.