»
AnglaisFran�aisVietnamien

Imprimer - Pass multiples valeurs - JavaScriptBank.com

Version compl�te: jsB@nk » Form » Pass multiples valeurs
URL: https://www.javascriptbank.com/pass-multiple-values.html

Pass multiples valeurs © JavaScriptBank.comLes valeurs choisies à partir de la liste déroulante apparaîtra dans la textarea en dessous. Comme plusieurs éléments sont sélectionnés, ils sont ajoutés à la liste.

Version compl�te: jsB@nk » Form » Pass multiples valeurs
URL: https://www.javascriptbank.com/pass-multiple-values.html



JavaScript
<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-->


HTML
<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-->