View Full Version : Inserting text into textarea via link.

02-02-2004, 09:08 PM
I wish to have a set of links that when clicked on enter's some text into a textarea.

I am going to use it to create a forum to add things like "[url]" and so forth.

This is probably really simple, but I'm rubbish at Javascript.

Thanks a lot,


02-02-2004, 10:07 PM
document.formname.textboxname.value='your message';


02-02-2004, 10:17 PM
How would I implement this onto the page? I tried using <a href="javascript: onClick=document.formname.textboxname.value='whatever';></a>, but it posted the text on a new page?

I changed the name of the form and textbox to match the code.

I told you I'm useless at Javascript :P

02-02-2004, 10:29 PM
buttons tend to have better functionalty but you can use links.

<input type="button" value="Click ME!" onClick="document.formname.textboxname.value='boo'">


02-02-2004, 10:34 PM
Thanks a lot. Works great now :D

02-03-2004, 02:23 AM
I need more help ,

It dous work but I need the function to ADD some text or in this case a Tag to the textarea .

Like the function is now it overwrite all the data inside it :confused: .

Thanks in advance

02-03-2004, 02:55 AM
onClick="document.formname.textboxname.value+=' added text'">

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum