-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi, I need some help here, lets say i have an TextBox and i have a text ie = "Hello World"; then i click the TextBox between "o" and "r", so the rough appeareance should be like this "Hello Wo|rld". where | = is my current pointer.
Is there anyway i could read my pointer position ?, in this case the pointer position should be after the eight character.
sorry for my bad english. i hope you understand
Regards,
Klepon
Hello kleponboy,
At the following url you can find the solution to your problem:
http://forum.zkoss.org/question/57850/textbox-cursor-position/
Code Sample from jimmyshiau:
<zk>
<textbox id="tb" onMyClick='msg.value = event.getData()+"";' />
<label id="msg"/>
<zscript><![CDATA[
tb.setWidgetListener("onClick",
"zAu.send(new zk.Event(this,\"onMyClick\", zk(this.$n()).getSelectionRange()[1]));");
]]></zscript>
</zk>
Best Regards,
Darksu
Asked: 2014-12-31 08:59:16 +0800
Seen: 7 times
Last updated: Jan 04 '15