Listbox Value to TextArea

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: 634 posts

Joined: Dec 1999

Hi Mike,

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

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.