Re: Numeric Filter on TextField

2012-01-06 Thread codix
Thank you for the reply. I was thinking of integrating it not on the HTML markup but on the class itself. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Numeric-Filter-on-TextField-tp4264649p4268648.html Sent from the Users forum mailing list archive at Nabble.com.

Re: Numeric Filter on TextField

2012-01-06 Thread Rain... Is wet!
Maybe this is more helpful to You than my previous post: http://www.mkyong.com/wicket/how-to-dynamic-add-attribute-to-a-html-tag-in-wicket/ - Never forget your umbrella ! In case You did, try to find a shelter ;) -- View this message in context:

Re: Numeric Filter on TextField

2012-01-05 Thread François Meillet
Have a look to http://stackoverflow.com/questions/469357/html-text-input-allow-only-numeric-input François Le 5 janv. 2012 à 09:16, codix a écrit : I have a TextField for filtering the data in a DataTable. However, the rows in the table is purely numeric. How do I prevent users from

Re: Numeric Filter on TextField

2012-01-05 Thread Rain... Is wet!
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