In the markup, add the attribute "onkeypress="YOURFUNCTION(event)" to your
textfield.

In your function get the keycode from the event and then use if/else or
switch/case to return true on every keycode from 47 to 57 (ASCII-codes for 0
to 9) or to return false for any other keycode.
Get yourself an ASCII-table to find other keycodes that might be worth to be
lettin through (ENTER on IE8, or ctrl on FF and others).

-----
Never forget your umbrella ! In case You did, try to find a shelter ;)
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Numeric-Filter-on-TextField-tp4264649p4265030.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to