i want to set numeric as well as password validation in TextField.
here is my code.
public TextField getPinNo()
{
if(pinno==null)
{
pinno= new TextField("PIN", null,4, TextField.PASSWORD);
pinno.setConstraints(TextField.NUMERIC);
}
return pinno;
}
after setting numeric validation my password validation stop working.
The constraints flags for the TextField object can be combined using the bitwise OR operator. As you can read at the TextField API Doc:
So, the resulting code could look like: