Dudeman4560
MIS
I'm trying to have it, so that when a user clicks on an item in the dropdown menu it will show up in a textbox next to it.
What I'm currently using is the same as
Which uses the code below.
Thanks
START OF CODE
<script language="JavaScript" type="text/JavaScript">
function addOptions(chosen) {
var selbox = document.myform.opttwo;
if (selbox.options[0].value == " ") {
selbox.options.length = 0;
}
var fnd = 0;
for (n=0;n<selbox.length;n++){
if(selbox.options[n].text == chosen){
fnd = 1;
}}
if (!fnd) selbox.options[selbox.options.length] = new Option(chosen, selbox.options.length);
}
function delOptions(chosen) {
var selbox = document.myform.opttwo;
if (selbox.options[0].value != " ") {
nomatch = new Array();
for (n=0;n<selbox.length;n++){
if(selbox.options[n].text != chosen){
nomatch[nomatch.length] = new Array(selbox.options[n].value, selbox.options[n].text);
}}
selbox.options.length = 0;
if (nomatch.length == 0) {
selbox.options[0]= new Option("Select entries from the list at left"," ");
} else {
for (n=0;n<nomatch.length;n++){
selbox.options[n] = new Option(nomatch[n][1], nomatch[n] [0]);
}}}}
</script>
<form name="myform">
<div
align="center">
<select name="optone" size="1">
<option value=" "
selected="selected"> </option>
<option value="First Choice">First
Choice</option>
<option value="Second Choice">Second
Choice</option>
<option value="Third Choice">Third
Choice</option>
</select>
<select name="opttwo" size="1">
<option value=" "
selected="selected">Select entries from the list at
left </option>
</select>
<br />
<br />
<input name="add" value="Add"
onclick="addOptions(document.myform.optone.options[document.myform.optone.selectedIndex].text);"
type="button" /> <input
name="del" value="Remove"
onclick="delOptions(document.myform.opttwo.options[document.myform.opttwo.selectedIndex].text);"
type="button" /></div>
</form>
END OF CODE
What I'm currently using is the same as
Which uses the code below.
Thanks
START OF CODE
<script language="JavaScript" type="text/JavaScript">
function addOptions(chosen) {
var selbox = document.myform.opttwo;
if (selbox.options[0].value == " ") {
selbox.options.length = 0;
}
var fnd = 0;
for (n=0;n<selbox.length;n++){
if(selbox.options[n].text == chosen){
fnd = 1;
}}
if (!fnd) selbox.options[selbox.options.length] = new Option(chosen, selbox.options.length);
}
function delOptions(chosen) {
var selbox = document.myform.opttwo;
if (selbox.options[0].value != " ") {
nomatch = new Array();
for (n=0;n<selbox.length;n++){
if(selbox.options[n].text != chosen){
nomatch[nomatch.length] = new Array(selbox.options[n].value, selbox.options[n].text);
}}
selbox.options.length = 0;
if (nomatch.length == 0) {
selbox.options[0]= new Option("Select entries from the list at left"," ");
} else {
for (n=0;n<nomatch.length;n++){
selbox.options[n] = new Option(nomatch[n][1], nomatch[n] [0]);
}}}}
</script>
<form name="myform">
<div
align="center">
<select name="optone" size="1">
<option value=" "
selected="selected"> </option>
<option value="First Choice">First
Choice</option>
<option value="Second Choice">Second
Choice</option>
<option value="Third Choice">Third
Choice</option>
</select>
<select name="opttwo" size="1">
<option value=" "
selected="selected">Select entries from the list at
left </option>
</select>
<br />
<br />
<input name="add" value="Add"
onclick="addOptions(document.myform.optone.options[document.myform.optone.selectedIndex].text);"
type="button" /> <input
name="del" value="Remove"
onclick="delOptions(document.myform.opttwo.options[document.myform.opttwo.selectedIndex].text);"
type="button" /></div>
</form>
END OF CODE