Hi there
I have a program which is reading a list of names from a table in the database.
I am wanting a user to select specific names and then these names will be
available in the rest of the application (i.e. a cut down list from over 100 to
approx 20).
Basically I have a select box where are user can click on a name in the left
box and move it to the right box. This part all works. What I am hoping
someone can tell me is the following. Is there anyway that when a person
clicks on a name in the left that it is automatically highlighted in the
right-hand side box.
Thanks in advance
Here is the code that I have.
<script language="JavaScript">
<!-- hide
function customSubmit(whereto) { //if edit change the action to include
document.forms[0].action = "content1.cfm" + whereto
document.forms[0].submit()
}
function moveOver() {
var boxLength = document.choiceForm.choiceBox.length;
var selectedItem = document.choiceForm.available.selectedIndex;
var selectedText =
document.choiceForm.available.options[selectedItem].text;
var selectedValue =
document.choiceForm.available.options[selectedItem].value;
var i;
var isNew = true;
if (boxLength != 0) {
for (i = 0; i < boxLength; i++) {
thisitem =
document.choiceForm.choiceBox.options[i].text;
if (thisitem == selectedText) {
isNew = false;
break;
}
}
}
if (isNew) {
newoption = new Option(selectedText, selectedValue,
false, false);
document.choiceForm.choiceBox.options[boxLength] =
newoption;
}
document.choiceForm.available.selectedIndex=-1;
}
function removeMe() {
var boxLength = document.choiceForm.choiceBox.length;
arrSelected = new Array();
var count = 0;
for (i = 0; i < boxLength; i++) {
if (document.choiceForm.choiceBox.options[i].selected) {
arrSelected[count] =
document.choiceForm.choiceBox.options[i].value;
}
count++;
}
var x;
for (i = 0; i < boxLength; i++) {
for (x = 0; x < arrSelected.length; x++) {
if
(document.choiceForm.choiceBox.options[i].value == arrSelected[x]) {
document.choiceForm.choiceBox.options[i] = null;
}
}
boxLength = document.choiceForm.choiceBox.length;
}
}
function saveMe() {
var strValues = "";
var boxLength = document.choiceForm.choiceBox.length;
var count = 0;
if (boxLength != 0) {
for (i = 0; i < boxLength; i++) {
if (count == 0) {
strValues =
document.choiceForm.choiceBox.options[i].value;
}
else {
strValues = strValues + "," +
document.choiceForm.choiceBox.options[i].value;
}
count++;
}
}
document.choiceForm.peoplelist.value = strValues;
//alert("Here are the values you've selected:\r\n" + strValues);
document.choiceForm.submit();
}
function showSave() {
document.getElementById('freddo').style.display = ""
}
//-->
</script>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:298640
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4