|
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]
|