Ivan Conway

unread,
Jul 26, 2017, 11:26:18 PM7/26/17
to mitappinv...@googlegroups.com

Hi
I would like to know how to capitalize the first letter in a user ID input text box.  Eg. Change a01234 to A01234 when user types in the ID.
 My understanding is that I would most likely need to place a Procedure in my When TextBox1 .Got Focus block, But not sure how to achieve it.
Ivan


Taifun

unread,
Jul 27, 2017, 9:34:19 AM7/27/17
to MIT App Inventor Forum
you might want to use the TextUtils extension from Appybuilder

Taifun

Abraham Getzler

unread,
Jul 27, 2017, 11:09:22 AM7/27/17
to MIT App Inventor Forum
There's no Submit button?
That's typically where you would put cleanup and validation.

Also, if the only alphabetic character in the user ID is the first one,
you can just set Textbox1.Tex to upshift(Textbox1.Text) (in the text blocks, maybe different name)

BTW, that's an awful name for a Textbox.
You can rename it easily in the Designer, and every reference will follow.

ABG

Hossein Amerkashi

unread,
Jul 27, 2017, 11:17:48 AM7/27/17
to MIT App Inventor Forum

Abraham Getzler

unread,
Jul 27, 2017, 11:28:13 AM7/27/17
to MIT App Inventor Forum

Ivan Conway

unread,
Jul 27, 2017, 6:46:47 PM7/27/17
to MIT App Inventor Forum
Hi Abraham,
Celebrant_Connection is actually the submit button which which calls the URL. I have now renamed to Connect to comply with your comment. :-)  I will experiment with your comment regarding resetting TextBox1.
Thanks - Ivan 

Ivan Conway

unread,
Jul 27, 2017, 8:45:17 PM7/27/17
to MIT App Inventor Forum
Hi,
Thank you for the tip.  I have had a look at the TextUtils Extension and it has some interesting capabilities.  Is it possible to download the extension and use it in App Inventor2?

Hossein Amerkashi

unread,
Jul 27, 2017, 8:57:45 PM7/27/17
to MIT App Inventor Forum
@Ivan,

Yes, it works with MIT AI2. 
Extension link is at bottom of blog post: https://amerkashi.wordpress.com/2017/03/09/textutils-extension/


-Hossein.

Ivan Conway

unread,
Jul 28, 2017, 12:31:31 AM7/28/17
to MIT App Inventor Forum
Hi,
Thank You,
I have downloaded and installed the extension.  I just need to work out how to apply it to my blocks so that when the user inputs the ID with the first letter in lowercase into the text box, the extension will automatically convert it to upper case. 

SteveJG

unread,
Jul 28, 2017, 7:59:18 AM7/28/17
to MIT App Inventor Forum
This can be very simple Ivan.

The above blocks will change a01234 to A01234  , place these three blocks immediately prior to executing your sign in but after 
the user types all the pass code. and before he/she presses the 'execute' button or whatever it is called.

This simple code will work for you because you only have a single alphanumeric character that needs changing; upcase will leave the numerals unchanged.

Regards,
Steve






Hossein Amerkashi

unread,
Jul 28, 2017, 8:03:54 AM7/28/17
to MIT App Inventor Forum
Steve, the upcase will convert all alpha to upper. It'll work for a01234 to A01234, but not when word has multiple alpha chars. However, given @Ivan's requirement, it may be sufficient for him.

-Hossein.
AppyBuilder.com

Hossein Amerkashi

unread,
Jul 28, 2017, 8:12:24 AM7/28/17
to MIT App Inventor Forum
FYI, see attached that shows result when using TextUtils.TitleCase.

-Hossein.
AppyBuilder.com
foo.png

SteveJG

unread,
Jul 28, 2017, 8:27:25 AM7/28/17
to MIT App Inventor Forum
@ Hossein      Hi.   Correct, upcase converts what Ivan wants using native AI2 blocks.   No reason for him to deal with loading an extension. Native blocks in this 
case results in a cleaner app because all his sign in codes have the form  A1234.

:)

--Steve

Hossein Amerkashi

unread,
Jul 28, 2017, 8:29:31 AM7/28/17
to MIT App Inventor Forum
Steve,

Yes, you are correct.

-Hossein.
AppyBuilder.com

Ivan Conway

unread,
Jul 28, 2017, 11:52:26 PM7/28/17
to MIT App Inventor Forum
Hi Steve,
Sincere thanks, 
That code worked fine, I was on the right track myself but was putting the code in the wrong block.
All sorted.  Ivan :-)

Ivan Conway

unread,
Jul 29, 2017, 12:15:10 AM7/29/17
to MIT App Inventor Forum
Hi Hossein,
Thank you for your help.  Steve's idea worked for me, as I said to Steve I had it right but in the wrong block.
I now have the Text Utils extension installed so I am going to have a play with it.
Thanks again
Ivan
Reply all
Reply to author
Forward
0 new messages