944,050 Members | Top Members by Rank

Ad:
Oct 9th, 2009
1

How to get textbox cursor position?

Expand Post »
Hi guys,

I am facing a weird problems which is i am fail to get cursor position at DIV at IE8 but work at IE7 or IE6. Can anyone tell me how to solve this problem.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
nokomoli is offline Offline
26 posts
since Nov 2007
Oct 9th, 2009
0
Re: How to get textbox cursor position?
post your code here
Reputation Points: 29
Solved Threads: 76
Practically a Master Poster
network18 is offline Offline
616 posts
since Sep 2009
Oct 11th, 2009
0
Re: How to get textbox cursor position?
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. function getSelectionStart(o) {
  2. if (o.createTextRange) {
  3. var r = document.selection.createRange().duplicate();
  4. r.moveEnd('character', o.value.length);
  5. if (r.text == '')
  6. return o.value.length;
  7. return o.value.lastIndexOf(r.text);
  8. }
  9. else
  10. return o.selectionStart;
  11. }
  12. function ChooseTag(obj1)
  13. {
  14. s = getSelectionStart(obj1);
  15. obj1.innerHTML = obj1.innerHTML + obj.value;
  16. }
Reputation Points: 10
Solved Threads: 0
Light Poster
nokomoli is offline Offline
26 posts
since Nov 2007
Oct 12th, 2009
0
Re: How to get textbox cursor position?
Click to Expand / Collapse  Quote originally posted by yonker ...
o good
what means??
Reputation Points: 10
Solved Threads: 0
Light Poster
nokomoli is offline Offline
26 posts
since Nov 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: reloading concept in ajax
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: use js to populate a value in css





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC