Jump to content

Cursor location store and return help!


assasin

Recommended Posts

I need a script that will store the location of the cursor so when a button is clicked it can insert some text where the cursor was in the txt box.

Here is a [url=http://experts.about.com/q/Javascript-1520/Inserting-text-text-area.htm]link to a script[/url] I found by googleing but it only works in IE and I need mine to work in FIreFox and IE.

Basicly I am making a BB code WYSIWYG interface! so when say a smiley image is clicked the html will be inserted into the text box at the cursors last location.

Can anyone help?
I suggest you take a look here: [url=http://www.bazon.net/mishoo/articles.epl?art_id=1292]http://www.bazon.net/mishoo/articles.epl?art_id=1292[/url].

Basically, you need to use a TextRange in IE, and handle the selection in FF.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.