I have a select list that doesnt want to behave. The left side willbe/is generated by the database and the right side is the insert field. The select list works properly and I can switch it from one list to the other. However, when I go to submit the form it does not accept the items in the right list unless I manually select them and then press submit.
I have tried to use a highlight text script like used for textboxes but it doesnt work on the select boxes
Select List:
"<td colspan=""1"">" & vbNewLine & _
"Recipients: <br/>" & vbNewLine & _
"<select multiple size=""5"" name=""list1"" style=""width:100"">" & vbNewLine & _
"<option value=""1"">Ben Smith</option>" & vbNewLine & _
"<option value=""D"">Dispatch</option>" & vbNewLine & _
"<option value=""V"">Dev</option>" & vbNewLine & _
"</SELECT>" & vbNewLine & _
"</td>" & vbNewLine & _
"<td>" & vbNewLine & _
"<input type=""button"" onClick=""move(this.form.frmMemoRecipients,this.form.list1)"" value=""<<"">" & vbNewLine & _
"<input type=""button"" onClick=""move(this.form.list1,this.form.frmMemoRecipients)"" value="">>"">" & vbNewLine & _
"</td>" & vbNewLine & _
"<td>" & vbNewLine & _
"<br/>" & vbNewLine & _
"<select multiple size=""5"" name=""frmMemoRecipients"" style=""width:100"">" & vbNewLine & _
"</select>" & vbNewLine & _
"</td>" & vbNewLine & _
"</tr>" & vbNewLine & _
"<tr>" & vbNewLine & _
"<td colspan=""4"" valign=""top"" align=""right"">" & vbNewLine & _
"<input onClick=""selectText()"" type=""Submit"" Value=""Submit"" Name=""Submit"">" & vbNewLine & _
"</td>" & vbNewLine & _
"</tr>" & vbNewLine & _
Move & Highlight Javascript
function move(fbox, tbox) {
var arrFbox = new Array();
var arrTbox = new Array();
var arrLookup = new Array();
var i;
for (i = 0; i < tbox.options.length; i++) {
arrLookup[tbox.options[i].text] = tbox.options[i].value;
arrTbox[i] = tbox.options[i].text;
}
var fLength = 0;
var tLength = arrTbox.length;
for(i = 0; i < fbox.options.length; i++) {
arrLookup[fbox.options[i].text] = fbox.options[i].value;
if (fbox.options[i].selected && fbox.options[i].value != "") {
arrTbox[tLength] = fbox.options[i].text;
tLength++;
}
else {
arrFbox[fLength] = fbox.options[i].text;
fLength++;
}
}
arrFbox.sort();
arrTbox.sort();
fbox.length = 0;
tbox.length = 0;
var c;
for(c = 0; c < arrFbox.length; c++) {
var no = new Option();
no.value = arrLookup[arrFbox[c]];
no.text = arrFbox[c];
fbox[c] = no;
}
for(c = 0; c < arrTbox.length; c++) {
var no = new Option();
no.value = arrLookup[arrTbox[c]];
no.text = arrTbox[c];
tbox[c] = no;
}
}
// End -->
</SCRIPT>
<script>
// Copyright 2001 by www.CodeBelly.com
// Do *not* remove this notice.
function selectText(){
document.memoform.frmMemoRecipients.focus();
document.memoform.frmMemoRecipients.select();
}
</script>