You are here: Re: Inserting text into a textarea « PHP Programming Language « IT news, forums, messages
Re: Inserting text into a textarea

Posted by Captain Paralytic on 09/04/07 14:53

On 4 Sep, 15:38, cresh <davebow...@gmail.com> wrote:
> Hello all,
>
> I'm in need of some help with inserting text into a textarea. I have
> this (below)which actually REPLACES all text in the text area. I just
> need the text to be added to existing text there.
>
> /begincode
>
> <head>
> <script>
> function InsertText(mytext){
> document.Form.message.value = mytext;}
>
> </script>
> </head>
>
> .....
>
> <input type="button" onclick="InsertText('This text is added.')"
> value="AddText">
> <textarea name="message" cols="60" rows="5"></textarea>
>
> /endcode
>
> This text replaces what's already in the box if I click the button.
> What I want is to add the text when the button is clicked, not replace
> what is already in the text area.
>
> Thanks very much for any assistance.
>
> DB

At a guess, something like:

function InsertText(mytext){
document.Form.message.value = document.Form.message.value+" "+mytext;


}

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация