Question : Change text input field value with dropdown menu selection.

I have a text input field that I use for embedding video.  I need to have a size selection dropdown menu that will change the code within the text field to reflect the various sizes of S (small) M (medium) and L (large).

I have attached the code that should be inserted into the text field upon the size selection.

Any help would be greatly appreciated!
1:
2:
---- SMALL CODE BELOW ----
<div style="height: 440px; width: 450px; background:url(http://thetripped.com/video/embedBg.png) no-repeat;"><embed src="http://thetripped.com/video/gddflvplayer.swf" flashvars="&desc=The%20Trip%20%2B%2B%20http%3A%2F%2Fthetripped%2Ecom&vdo=http%3A%2F%2Fthetripped%2Ecom%2Fvideo%2Fpromo%2Dvideo%2Emp4&splashscreen=http%3A%2F%2Fthetripped%2Ecom%2Fvideo%2Fposter%2Ejpg" width="320" height="240" allowFullScreen="true" quality="best" wmode="transparent" allowScriptAccess="always"  pluginspage="http://www.macromedia.com/go/getflashplayer"  type="application/x-shockwave-flash" style="margin-left: 116px; margin-top: 35px;"></embed></div>
1:
2:
-----MEDIUM CODE BELOW-------
<div style="height: 525px; width: 575px; background:url(http://thetripped.com/video/embedBg.png) no-repeat bottom left;"><embed src="http://thetripped.com/video/gddflvplayer.swf" flashvars="&desc=The%20Trip%20%2B%2B%20http%3A%2F%2Fthetripped%2Ecom&vdo=http%3A%2F%2Fthetripped%2Ecom%2Fvideo%2Fpromo%2Dvideo%2Emp4&splashscreen=http%3A%2F%2Fthetripped%2Ecom%2Fvideo%2Fposter%2Ejpg" width="450" height="340" allowFullScreen="true" quality="best" wmode="transparent" allowScriptAccess="always"  pluginspage="http://www.macromedia.com/go/getflashplayer"  type="application/x-shockwave-flash" style="margin-left: 120px; margin-top: 10px;"></embed></div>
1:
2:
------LARGE CODE BELOW--------
<div style="height: 626px; width: 720px; background:url(http://thetripped.com/video/embedBg.png) no-repeat bottom left;"><embed src="http://thetripped.com/video/gddflvplayer.swf" flashvars="&desc=The%20Trip%20%2B%2B%20http%3A%2F%2Fthetripped%2Ecom&vdo=http%3A%2F%2Fthetripped%2Ecom%2Fvideo%2Fpromo%2Dvideo%2Emp4&splashscreen=http%3A%2F%2Fthetripped%2Ecom%2Fvideo%2Fposter%2Ejpg" width="550" height="440" allowFullScreen="true" quality="best" wmode="transparent" allowScriptAccess="always"  pluginspage="http://www.macromedia.com/go/getflashplayer"  type="application/x-shockwave-flash" style="margin-left: 120px; margin-top: 10px;"></embed></div>

Answer : Change text input field value with dropdown menu selection.

here...
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
<script>
function getCode(){
  var s = document.getElementById("selSize").value;
  var t = document.getElementById("txtCode");
  if (s=="S") t.value = '<div style="height: 440px; width: 450px; background:url(http://thetripped.com/video/embedBg.png) no-repeat;"><embed src="http://thetripped.com/video/gddflvplayer.swf" flashvars="&desc=The%20Trip%20%2B%2B%20http%3A%2F%2Fthetripped%2Ecom&vdo=http%3A%2F%2Fthetripped%2Ecom%2Fvideo%2Fpromo%2Dvideo%2Emp4&splashscreen=http%3A%2F%2Fthetripped%2Ecom%2Fvideo%2Fposter%2Ejpg" width="320" height="240" allowFullScreen="true" quality="best" wmode="transparent" allowScriptAccess="always"  pluginspage="http://www.macromedia.com/go/getflashplayer"  type="application/x-shockwave-flash" style="margin-left: 116px; margin-top: 35px;"></embed></div>';
  if (s=="M") t.value = '<div style="height: 525px; width: 575px; background:url(http://thetripped.com/video/embedBg.png) no-repeat bottom left;"><embed src="http://thetripped.com/video/gddflvplayer.swf" flashvars="&desc=The%20Trip%20%2B%2B%20http%3A%2F%2Fthetripped%2Ecom&vdo=http%3A%2F%2Fthetripped%2Ecom%2Fvideo%2Fpromo%2Dvideo%2Emp4&splashscreen=http%3A%2F%2Fthetripped%2Ecom%2Fvideo%2Fposter%2Ejpg" width="450" height="340" allowFullScreen="true" quality="best" wmode="transparent" allowScriptAccess="always"  pluginspage="http://www.macromedia.com/go/getflashplayer"  type="application/x-shockwave-flash" style="margin-left: 120px; margin-top: 10px;"></embed></div>';
  if (s=="L") t.value = '<div style="height: 626px; width: 720px; background:url(http://thetripped.com/video/embedBg.png) no-repeat bottom left;"><embed src="http://thetripped.com/video/gddflvplayer.swf" flashvars="&desc=The%20Trip%20%2B%2B%20http%3A%2F%2Fthetripped%2Ecom&vdo=http%3A%2F%2Fthetripped%2Ecom%2Fvideo%2Fpromo%2Dvideo%2Emp4&splashscreen=http%3A%2F%2Fthetripped%2Ecom%2Fvideo%2Fposter%2Ejpg" width="550" height="440" allowFullScreen="true" quality="best" wmode="transparent" allowScriptAccess="always"  pluginspage="http://www.macromedia.com/go/getflashplayer"  type="application/x-shockwave-flash" style="margin-left: 120px; margin-top: 10px;"></embed></div>';
}
</script>

<select id=selSize>
<option value=S> Small</option>
<option value=M> Medium</option>
<option value=L> Large</option>
</select> 

<button onClick="getCode()">Get Code</button>

<br>

<textarea id=txtCode cols=120 rows=6></textarea>
Random Solutions  
 
programming4us programming4us