Hi
I have a script that passing multiple value to listbox
but that is based on one particular combobox..
besides this combobox values and want to add one textbox value next to this combobox value
for example so combobox value = "test"
textbox value "5"
in the listbox should appear "test 5"
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
oldvalue = "";
function passText(passedvalue) {
if (passedvalue != "") {
var totalvalue = passedvalue+"\n"+oldvalue;
document.displayform.itemsbox.value = totalvalue;
oldvalue = document.displayform.itemsbox.value;
}
}
</script>
</HEAD>
<BODY>
<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>
<label>Quantity
<input type="text" name="psn" id="psn" />
</label>
<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>
</body>
</html>
Please advise
I have a script that passing multiple value to listbox
but that is based on one particular combobox..
besides this combobox values and want to add one textbox value next to this combobox value
for example so combobox value = "test"
textbox value "5"
in the listbox should appear "test 5"
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
oldvalue = "";
function passText(passedvalue) {
if (passedvalue != "") {
var totalvalue = passedvalue+"\n"+oldvalue;
document.displayform.itemsbox.value = totalvalue;
oldvalue = document.displayform.itemsbox.value;
}
}
</script>
</HEAD>
<BODY>
<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>
<label>Quantity
<input type="text" name="psn" id="psn" />
</label>
<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>
</body>
</html>
Please advise