I have a drop down menu which does add remove functions from 1 drop down to
another , and aslo have up and down arrows which do the respective movement.
Now I need to find a way how to update the sort order in the database if I move
the item up/down. The application is written IN CF.
Here is my move script
function moveUpDown(to) {
var list2 = document.forms[0].requirements;
var index = list2.selectedIndex;
var total = list2.options.length-1;
if (index == -1) return false;
if (to == +1 && index == total) return false;
if (to == -1 && index == 0) return false;
var items = new Array;
var values = new Array;
for (i = total; i >= 0; i--) {
items[i] = list2.options[i].text;
values[i] = list2.options[i].value;
}
for (i = total; i >= 0; i--) {
if (index == i) {
list2.options[i + to] = new Option(items[i],values[i + to], 0, 1);
list2.options[i] = new Option(items[i + to], values[i]);
i--;
}
else {
list2.options[i] = new Option(items[i], values[i]);
}
}
list2.focus();
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290230
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4