Only numbers allowed in TextEdit

304 views
Skip to first unread message

soczek

unread,
Jan 24, 2020, 5:15:59 PM1/24/20
to DroidScript
I want to make a text box where you can enter your weight. I created a TextEdit object, but I don't know how to make it accept only numbers. Do you have any ideas?

Steve Garman

unread,
Jan 24, 2020, 5:57:34 PM1/24/20
to DroidScript
You can start by giving the user a numeric keyboard using the "number" option

edt = app.CreateTextEdit("20", -1, -1, "number");

Then you can do whatever verification is necessary in the
edt.SetOnChange
callback

soczek

unread,
Jan 29, 2020, 2:29:53 AM1/29/20
to DroidScript
Thanks Steve! :)

EL'elyon most high God RAPHA

unread,
Sep 15, 2024, 2:41:58 AM9/15/24
to DroidScript
[0,1,2,34,5,6,7,8,9]

On Wednesday, January 29, 2020 at 2:29:53 AM UTC-5 imejl....@gmail.com wrote:
Thanks Steve! :)
Reply all
Reply to author
Forward
0 new messages