View Full Version : two questions. forums and embed

04-23-2007, 04:35 PM
I'm confused about how to put text on in to a textarea.
if you had a select list or another textarea where you were moving the text from one area to another.
you could use push or if you were using select you could use seleced index's name and use it as the value of the textarea right?

If you wanted to do that with the selected index's value you do the same?

also I saw a code in a book to use document.write to write out the object and embed tags.

if I wanted to try and embed WMP or Quicktime and I had the codebase
would I use try catch to find out what player the person had.

04-23-2007, 07:52 PM
1. Getting text from a select to a text area.

d = document;
var textAreaElem = d.getElementById("textID")
var selectElem = d.getElementById("selectID")
textAreaElem.value = selectElem.options[selectElem.selectedIndex].value

2. Try and Catch to determine client plugins
I don't know, give them the option anyway.

3. document.write use
Only use it when the page is loading, otherwise it will remove everything else!

04-25-2007, 08:49 PM
document write is that bad.

I thoug I tryed that index thing before