Jump to content

Archived

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

assasin

Cursor location store and return help!

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

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.