Welcome to Dream.In.Code
Become an Expert!

Join 149,523 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,437 people online right now. Registration is fast and FREE... Join Now!




get the Cursor position in the TextBox...

 
Reply to this topicStart new topic

get the Cursor position in the TextBox...

vivekthangaswamy
6 Jun, 2007 - 05:27 AM
Post #1

New D.I.C Head
*

Joined: 1 Nov, 2006
Posts: 4


My Contributions
i like to get the Cursor position in the TextBox.
where ever i refer i get the code using
var range = document.selection.createRange();
i need a code snippet without using 'document'. can anyone help me.


User is offlineProfile CardPM
+Quote Post

girasquid
RE: Get The Cursor Position In The TextBox...
6 Jun, 2007 - 10:00 AM
Post #2

Barbarbar
Group Icon

Joined: 3 Oct, 2006
Posts: 1,294



Thanked: 18 times
Dream Kudos: 725
My Contributions
Why can't you use document?
User is offlineProfile CardPM
+Quote Post

vivekthangaswamy
RE: Get The Cursor Position In The TextBox...
6 Jun, 2007 - 08:54 PM
Post #3

New D.I.C Head
*

Joined: 1 Nov, 2006
Posts: 4


My Contributions
QUOTE(girasquid @ 6 Jun, 2007 - 11:00 AM) *

Why can't you use document?


I will not get the Document details, because i'm using this JavaScript inside SharePoint 2007 and this part of javascript will added inside the Ajax AutoComplete Extender.

this line document.selection.createRange();
will return only [object] when run from my SharePoint 2007 page

And my code starts like this
// This is the Event that will fire
function Sys$UI$AutoCompleteBehavior$_onTimerTick(sender, eventArgs)
{
//TextBox Value this.get_element().value
var text = this.get_element().value;
....
from here i need to get those details...

Basically i need the autocomplete functionality works for delimited text char like in this article
http://www.codeproject.com/jscript/jsactb....;select=1823994



QUOTE(vivekthangaswamy @ 6 Jun, 2007 - 09:54 PM) *

QUOTE(girasquid @ 6 Jun, 2007 - 11:00 AM) *

Why can't you use document?


I will not get the Document details, because i'm using this JavaScript inside SharePoint 2007 and this part of javascript will added inside the Ajax AutoComplete Extender.

this line document.selection.createRange();
will return only [object] when run from my SharePoint 2007 page

And my code starts like this
// This is the Event that will fire
function Sys$UI$AutoCompleteBehavior$_onTimerTick(sender, eventArgs)
{
//TextBox Value this.get_element().value
var text = this.get_element().value;
....
from here i need to get those details...

Basically i need the autocomplete functionality works for delimited text char like in this article
http://www.codeproject.com/jscript/jsactb....;select=1823994



The follwoing code works fine, when typed mplungjan; followed by mplungjan;vivek;NET;expert; vice versa...
function Sys$UI$AutoCompleteBehavior$_onTimerTick(sender, eventArgs) {
if (this._serviceURL && this._serviceMethod) {
var text = this.get_element().value;
/**************************************************/
if ( text.lastIndexOf(this._separatorChar) > -1 )
{
// found separator char in the text
var pos = text.lastIndexOf(this._separatorChar);
pos++;
text = text.substring(pos, (text.length));
text = text.trim();
}

if ( !this._noMinimumPrefix && (text.trim().length < this._minimumPrefixLength) ) {
this._update('', null, false);
return;
}
----

when change the mplungjan;vivek;NET;expert; text in the middle like this mplungjan;google;NET;expert;
the text should return this google.

hope this clears my requirement to U
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 08:42PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month