f



Newbie question = how to add text to a textarea without deleting the previous text.

Newbie question = how to add text to a textarea without deleting the
previous text.

i'm trying to add text to a text area when a link is clicked (to
add<b><i> etc) without erasing the previously typed text.

i'm using this, but unfortunately i don't know how to make this append
the text rather than just chenge the text in the text area.(where
comments is the textarea name.


<A HREF="#" onClick="(document.forms[0].comments.value='<b></b>');
return false;"  NAME="anchor1" ID="anchor1">select bold</A>

thank you very much,
GD
0
GD
6/29/2007 2:39:56 AM
comp.lang.javascript 38370 articles. 2 followers. javascript4 (1315) is leader. Post Follow

2 Replies
716 Views

Similar Articles

[PageSpeed] 58

On Jun 29, 12:39 pm, GD <G...@cox.com> wrote:
> Newbie question = how to add text to a textarea without deleting the
> previous text.
>
> i'm trying to add text to a text area when a link is clicked (to
> add<b><i> etc) without erasing the previously typed text.
>
> i'm using this, but unfortunately i don't know how to make this append
> the text rather than just chenge the text in the text area.(where
> comments is the textarea name.
>
> <A HREF="#" onClick="(document.forms[0].comments.value='<b></b>');

<... onclick="(document.forms[0].comments.value += '<b></b>');


--
Rob

0
RobG
6/29/2007 2:44:34 AM
On Thu, 28 Jun 2007 19:44:34 -0700, RobG <rgqld@iinet.net.au> wrote:

>On Jun 29, 12:39 pm, GD <G...@cox.com> wrote:
>> Newbie question = how to add text to a textarea without deleting the
>> previous text.
>>
>> i'm trying to add text to a text area when a link is clicked (to
>> add<b><i> etc) without erasing the previously typed text.
>>
>> i'm using this, but unfortunately i don't know how to make this append
>> the text rather than just chenge the text in the text area.(where
>> comments is the textarea name.
>>
>> <A HREF="#" onClick="(document.forms[0].comments.value='<b></b>');
>
><... onclick="(document.forms[0].comments.value += '<b></b>');

thank you very much!! 

is there any way that if i highlight some text the tags that i'm
adding would replace that highlighted text?

thanks again,
GD


0
GD
6/29/2007 4:02:38 AM
Reply: