justuptime.com - monitor your servers & websites

Listbox Value to TextArea

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.

They have: 82 posts

Joined: Oct 2001

Hey guys,

How can I take a value from a listbox and insert it into a textarea when a user clicks the listbox?

For instance I have a listbox and a textarea. The listbox has the following items:
Item 1
Item 2
Item 3

The text area has the text "this is my text"

I want to click "Item 2" and append it to the "this is my text" in the text area.
These items are in the same form.

Thanks,

Mike

Blessed is the man who fears the LORD, who delights greatly in his commandments. Psalms 112:1

They have: 82 posts

Joined: Oct 2001

I figured this out

I just created a function to add it:

function AddField(Value){
document.getElementById("TEXTAREA").value = document.getElementById("TEXTAREA").value + Value;
}

Thanks,

Mike

Blessed is the man who fears the LORD, who delights greatly in his commandments. Psalms 112:1

Vincent Puglia's picture

They have: 629 posts

Joined: Dec 1999

Hi Mike,

I have the following comment regarding your solution:
...ById("TEXTAREA") implies your object looks like:

The Blades of Grass cut me still