0

How to limit user input key in textbox?

asked 2013-01-14 11:19:18 +0800

eck gravatar image eck
3

updated 2013-01-14 11:28:59 +0800

Hi,
I want to limit user input in textbox so user can only input A-Z,a-z and " ' " sign.
The constrain didn't help me because the constrain only show message but the user still can input the key other than that above. I want it like the intbox, which is the user cannot press key other than numeric.

I'm using zk 3.6.4

Thx.
Sorry for my english.

delete flag offensive retag edit

Comments

1

Hi, try using onChanging event in your text box ,and on press of any other key accept the required ,decrease your length by one,or try using on key press event.

nsharma ( 2013-03-19 10:20:03 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-01-14 17:18:12 +0800

roliroli gravatar image roliroli
164 4

updated 2013-01-14 17:18:25 +0800

Hi,

<textbox constraint="[0-9]+"/

http://books.zkoss.org/wiki/ZK_Component_Reference/Input/Textbox#Constraint

If it doesn't work, try use pure javascript approach to prevent user input
otherwise, maybe you should consider upgrade your zk version...
Good Luck

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2013-01-14 11:19:18 +0800

Seen: 93 times

Last updated: Mar 19 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More