PHP Code:
Trade_MyGralats.text.length() -= 1;
Trade_MyGralats.text.size() -= 1;
These make no sense, the return value of a function is not a variable.
PHP Code:
Trade_MyGralats.text -= 1;
text is a string, not a number, so this isn't going to work either.
PHP Code:
Trade_MyGralats.text = Trade_MyGralats.text.substring(0, Trade_MyGralats.text.length() - 1);
substring is the key. Probably you'd be better off just saving a copy of the old string (before letters were added) and then changing the text back to the old string if they enter a letter. Right now someone could just enter a letter anywhere but the end of the string and it wouldn't fix this.