Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cursor position

 
zheng yu
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to know cursor position when user click the text field.
In my situation , there has no keyboard . Input device is touch panel & mouse . i created some buttons like DEL , BS , etc .user can use mouse to position , use these buttons to edit .
Ca this be done by using javascript ?
Thanx in advance
ZY
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on the browser. I'm not sure about Netscape, but in IE there is an event object passed to your event handler by default. Inside of your event that handles the button click you can simply inspect the event.x and event.y properties to get the coordinates of the click.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic