Full version: jsB@nk » Form » Pass Multiple Values
URL: https://www.javascriptbank.com/pass-multiple-values.html
Values selected from the drop-down box appear in the textarea below. As more items are selected they are added to the list.
Full version: jsB@nk » Form » Pass Multiple Values
URL: https://www.javascriptbank.com/pass-multiple-values.html
<SCRIPT LANGUAGE="JavaScript">// Caleb Larsen ([email protected])<!-- Beginoldvalue = "";function passText(passedvalue) { if (passedvalue != "") { var totalvalue = passedvalue+"\n"+oldvalue; document.displayform.itemsbox.value = totalvalue; oldvalue = document.displayform.itemsbox.value; }}// End --></script><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<form name="selectform"><font face="Arial, Helvetica, Sans Serif" size="3"><b>Select an Item:</b></font><br><select name="dropdownbox" size=1><option value="">Make selection</option><option value="Item 1">Item 1</option><option value="Item 2">Item 2</option><option value="Item 3">Item 3</option><option value="Item 4">Item 4</option><option value="Item 5">Item 5</option><option value="Item 6">Item 6</option></select><input type=button value="Add to list" onClick="passText(this.form.dropdownbox.options[this.form.dropdownbox.selectedIndex].value);"></form><form name="displayform" ><font face="Arial, Helvetica, Sans Serif" size="3"><b>Items added to list:</b></font><br><textarea cols="40" rows="5" name="itemsbox" ></textarea></form><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->