Можно поизвращаться с textChange
Например у нас для поля ввода времени он такой:
PHP код:
public void textChange()
{
str newText = this.text();
str char;
int length;
int i;
int n;
container numbers = ['0','1','2','3','4','5','6','7','8','9'];
super();
length = strlen(newText);
char = substr(newText,length,1);
if (oldText != newText && confind(numbers,char))
{
char = substr(newText,length-1,1);
if (strlen(newText) > 1 && confind(numbers, char))
{
for (i=1; i<=length; i++)
{
if (!confind(numbers,substr(newText,i,1)))
{
n++;
}
}
if (n < 2)
{
oldText = newText + ':';
this.pasteText(':');
}
}
}
oldText = newText;
}