0

How to prevent the zkoss inbuilt constaints on intbox for calculated value like(2-1)

asked 2012-02-14 12:57:02 +0800

SudhakarReddy gravatar image SudhakarReddy
9

intbox allowing the calculating values how to prevent this in intbox

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2012-02-22 06:36:12 +0800

matthewgo gravatar image matthewgo
375

HI SudhakarReddy,

Please try the following code:

<zk xmlns:w="client">
<textbox>
<attribute w:name="getAllowedKeys_" >
	function () {
		return "0123456789+-*/";
	}
</attribute>
<attribute w:name="doKeyPress_" >
	function(evt){
		if (!this._shallIgnore(evt, this.getAllowedKeys_()))
			this.$supers('doKeyPress_', arguments);
	}
</attribute>
</textbox>
</zk>

link publish delete flag offensive edit
Your reply
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: 2012-02-14 12:57:02 +0800

Seen: 189 times

Last updated: Feb 22 '12

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