0

Read Text Pointer in the TextBox

asked 2014-12-31 08:59:16 +0800

kleponboy gravatar image kleponboy flag of Indonesia
54 5
http://stupidprogrammers....

updated 2014-12-31 08:59:57 +0800

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

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-01-04 09:55:45 +0800

Darksu gravatar image Darksu
1991 1 4

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

link publish delete flag offensive edit

Comments

dude, thanks a lot, you save my time :D

kleponboy ( 2015-01-05 03:34:36 +0800 )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
1 follower

RSS

Stats

Asked: 2014-12-31 08:59:16 +0800

Seen: 7 times

Last updated: Jan 04 '15

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