0

Textbox onChange Event Problem :( !

asked 2011-04-11 08:31:46 +0800

streak22 gravatar image streak22
93 2

Hi to everybody!

I write here because i have a problem with the event onChange in of a textbox.

I have a multiline textbox and the people insert data there. And i want that, when a ; is insert something happend.

I beleave that the method onChange must capture every key that was press but it capture only when the textbox lost focus. And the event onCHangin is not usefoul either because it is to slow in capture and, when capture, the las character doesnt appears...

I think that the problem is that the event onCHange doesn't work like it must be, but maybe I am wrong. Some one know a workarround or something like that?

I'm using ZK 505, Ubuntu 10.04, Netbeans and glasfish v3

Thanks for reading!

Joaquin

delete flag offensive retag edit

7 Replies

Sort by ยป oldest newest

answered 2011-04-11 08:46:52 +0800

tawa gravatar image tawa
162 1

maybe you can use the javascript function onkeypress :

<html><head><title>Test</title>
</head><body>
<form name="Test" action="">
<input type="text" size="30" name="Eingabe"
  onkeypress="alert(this.value)">
</form>
</body></html>

link publish delete flag offensive edit

answered 2011-04-11 09:58:44 +0800

streak22 gravatar image streak22
93 2

Thanks for answer!!!

And How i call a java function of a xxxxWindow.java file from that method?? Can be any way? Because I need that!

link publish delete flag offensive edit

answered 2011-04-11 10:00:35 +0800

caclark gravatar image caclark
1753 2 5
http://clarktrips.intltwi...

search the forums for zkau.send and if that fails, look here: Communicate with Server

link publish delete flag offensive edit

answered 2011-04-12 06:13:56 +0800

streak22 gravatar image streak22
93 2

Eyy!! Interesting... I don't know that i can send information to the server like this... Thanks!

Two questions:

-Have you got (or anyone) an example of this??? (a mini project or some code) I would

- The method onChange must be call every time that an user press a key in a textbox (or not?)... Why that happend don't happend to me :( ?? it is only call when the textbox lost the focus :(!


Joaquin

link publish delete flag offensive edit

answered 2011-04-13 06:59:33 +0800

streak22 gravatar image streak22
93 2

someone?

link publish delete flag offensive edit

answered 2011-04-13 07:20:07 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

onChange doesn't work for you, you have to listen on the onChanging-Event:

<zk>
 <textbox>
<attribute name="onChanging"><![CDATA[ 
   if(event.value.contains(";")) {
    alert("found ;");
   }
  ]]></attribute> 
</textbox>
</zk>

link publish delete flag offensive edit

answered 2011-04-14 05:09:44 +0800

tawa gravatar image tawa
162 1

try this:
http://www.zkoss.org/zksandbox/#e8

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: 2011-04-11 08:31:46 +0800

Seen: 1,829 times

Last updated: Nov 27 '11

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