1

I have used

this.passwordTextField = new TextField( "", "", 30, TextField.PASSWORD | TextField.DECIMAL);

to get the numeric value password field. but it still takes "#" as an entry and show "." for that at output. but I only need numbers. I also used

UiAccess.setInputMode( this.passwordTextField, UiAccess.MODE_NUMBERS);

how should i do that?

bharath
  • 14,283
  • 16
  • 57
  • 95
Esha
  • 33
  • 5

2 Answers2

2

It also can solved by using

  new TextField( "", "", 30, TextField.PASSWORD | TextField.MODE_NUMBERS );
Esha
  • 33
  • 5
1

Try this :

this.passwordTextField = new TextField( "", "", 30, TextField.PASSWORD | 
TextField.NUMERIC);

The textfield constraint with TextField.DECIMAL will allow the user to enter characters - and ., check this.

You can even be smatter by trying the constraint TextField.PASSWORD | TextField.NUMERIC | TextField.SENSITIVE

Vimal
  • 1,266
  • 1
  • 9
  • 16