chapimp
01-14-2003, 05:27 AM
This is passing values from one ListBox to another ListBox....
What Im trying to do is to leave the left ListBox and make the right one a Textarea, so that I could pass any of the ListBox values on to the textarea Without replacing whatever text I have already on the Textarea
If you get this one your The Best!!!
<html><head>
<script language="JavaScript">
function addSrcToDestList() {destList = window.document.forms[0].destList;srcList = window.document.forms[0].srcList; var len = destList.length;for(var i = 0; i < srcList.length; i++) {if ((srcList.options[i] != null) && (srcList.options[i].selected)) {
var found = false;for(var count = 0; count < len; count++) {if (destList != null) {if (srcList.options[i].text == destList.text) {}}}if (found != true) {destList[len] = new Option(srcList.options[i].text);
len++;}}}}
</SCRIPT></head><body>
<form method="POST">
<select size="5" name="srcList">
<option value="1">Item 1<option value="1">Item 2</select>
<input type="button" value=" > " onClick="javascript:addSrcToDestList()">
<select size="5" name="destList">
</select>
</form></body></html> :confused:
What Im trying to do is to leave the left ListBox and make the right one a Textarea, so that I could pass any of the ListBox values on to the textarea Without replacing whatever text I have already on the Textarea
If you get this one your The Best!!!
<html><head>
<script language="JavaScript">
function addSrcToDestList() {destList = window.document.forms[0].destList;srcList = window.document.forms[0].srcList; var len = destList.length;for(var i = 0; i < srcList.length; i++) {if ((srcList.options[i] != null) && (srcList.options[i].selected)) {
var found = false;for(var count = 0; count < len; count++) {if (destList != null) {if (srcList.options[i].text == destList.text) {}}}if (found != true) {destList[len] = new Option(srcList.options[i].text);
len++;}}}}
</SCRIPT></head><body>
<form method="POST">
<select size="5" name="srcList">
<option value="1">Item 1<option value="1">Item 2</select>
<input type="button" value=" > " onClick="javascript:addSrcToDestList()">
<select size="5" name="destList">
</select>
</form></body></html> :confused: