PDA

View Full Version : GUI TextEdit problem


Stowen
10-16-2013, 11:32 PM
Okay, so I'm creating a GUI with a text edit box. I wanted the box to be limited to numbers only, and I was under the impression that numbersonly = true; would make that happen. Turns out, it doesn't do anything at all, really. Anybody else have this issue?

cbk1994
10-16-2013, 11:44 PM
try
useOwnProfile = true;
profile.numbersOnly = true;

fowlplay4
10-17-2013, 12:09 AM
or write your own:


function TextEditControl.onTextChanged() {
temp.valid = "1234567890";
for (temp.i = 0; temp.i < TextEditControl.text.length(); temp.i++) {
temp.c = TextEditControl.charat(temp.i);
if (temp.valid.pos(temp.c) >= 0) temp.str @= temp.c;
}
TextEditControl.text = temp.str;
}

Stowen
10-17-2013, 12:27 AM
Thanks guys, much appreciated.

Both of them worked as well as expected.