On Mon, Aug 8, 2011 at 08:31, alexandr <[email protected]> wrote:
> Thanks, RegExp is good, but I am not expert in it... In my case i want to
> create money text field - only digits, only one dot and only two digits
> after dot... So I think, that I can do all checks inside keyinput event,
> and
> restrict input if need...
>
> About ReqExp - can my goal be achieved only by using RegExp?
>
A regular expression can certainly match what you're discussing:
/[0-9]+([0-9]{2})?/
but the "filter" regular expression matches each single character, not the
entire entered text, so no, it can't. You can expand on Gabriel's example,
which uses the filter and the changeValue event. If you set the "liveUpdate"
property to true, then the changeValue property will be fired on each key
press. (There is also an "input" event which is always fired on each key
press.) I don't think there's a way at this level to prevent the character
from being added to the field, so what you need to do is keep track of the
value of the field, and if the new character entered is not allowed, then
reset the field back to its previous value.
Derrell
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel