[thelist] Insert text where cursor is in textarea using JavaScript

Gilles Vincent g_vincent at ixo.fr
Wed Feb 6 04:43:01 CST 2002


I'm afraid it's not possible for TEXTAREA because of your the poor
implementation of DOM in this component (see below)..

on IE5+, you may use DHTML Editing Control provided with the browser (it
implements DOM level 2 Transversal - see
http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html)
(see http://standardbrains.editthispage.com/ for an example)

hope it help

----- Original Message -----
From: "Ryan Carmody" <carmodyryan at hotmail.com>
To: <thelist at lists.evolt.org>
Sent: Tuesday, February 05, 2002 11:02 PM
Subject: [thelist] Insert text where cursor is in textarea using JavaScript


> Hi all,
>
> I have a text area where an email message is to be typed.  There is also
an
> option to add a signature.  The code used to add the signature is as
follows
> -
>
> document.main.message.value +=
> unescape(signature_content(signature_selected));
>
> This works fine, but always inserts the signature at the end of the
message.
>   I would like to be able to insert the signature where the cursor is.  A
> problem came up when a user tried to insert their signature in an email
they
> were replying to...the signature appeared below the original messsage and
> not below their response.  If anyone has any advice or ideas for me I
would
> greatly appreciate it.
>
> Thanks,
> Ryan Carmody
>
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !





More information about the thelist mailing list