I have a select box with 5 options that can be moved up or down. Can
someone tell me why I'm getting the JS error Object doesn't support this
action? The functions are working the way they are suppose to work. Also,
how do I now take the values of the JS array and update a table. I need to
take the new JS array sequence numbers and update the table. How do I
reference JS_DisplaySeq and JS_MenuIDNO in the below query?

Update {table_name}
set DisplaySeq = {JS_DisplaySeq_Index}
where MenuIDNO = {JS_MenuIDNO}

Here's the entire page in static form, although I am dynamically building it
in CF.
<html>
<head>
<title>
moving an option up and down
</title>

<script type="text/javascript">
<!--
function DisplayOrder(MenuIDNO,MenuName,DisplaySeq){
this.MenuIDNO = MenuIDNO;
this.MenuName = MenuName;
this.DisplaySeq = DisplaySeq;
} 
var Sequence = new Array()

Sequence[0] = new Sequence(3,'Our Mission',1);

Sequence[1] = new Sequence(5,'Team Contact List',2);

Sequence[2] = new Sequence(4,'Organization Charts',3);

Sequence[3] = new Sequence(6,'Marketing Ops Recogniton',4);

Sequence[4] = new Sequence(7,'Spirit of Excellence',5);

Sequence[5] = new Sequence(8,'Hot Topics',6);

function drawtable(){
var xstr='<html><body><table>';
for(var i=0;i<Sequence.length; i++){
xstr=xstr+'<tr><td>' + Sequence[i].MenuIDNO;
xstr=xstr+'<tr><td>' + Sequence[i].MenuName;
xstr=xstr+'</td><td>' + Sequence[i].DisplaySeq;
xstr=xstr+'</td></tr>';

}
xstr+='</table></body></html>';

}

function moveSelected (select, down) {
if (select.selectedIndex != -1) {
if (down) {
if (select.selectedIndex != select.options.length - 1)
var i = select.selectedIndex + 1;
else
return;
}
else {
if (select.selectedIndex != 0)
var i = select.selectedIndex - 1;
else
return;
}
var swapOption = new Object();
swapOption.text = select.options[select.selectedIndex].text;
swapOption.value = select.options[select.selectedIndex].value;
swapOption.selected = select.options[select.selectedIndex].selected;
swapOption.defaultSelected = 
select.options[select.selectedIndex].defaultSelected;
for (var property in swapOption)
select.options[select.selectedIndex][property] = 
select.options[i][property];
for (var property in swapOption)
select.options[i][property] = swapOption[property];
}
}

function getSelectedIndices (select) {
var MenuIDNO = new Array();
for (var i = 0; i < select.options.length; i++)
if (select.options[i].selected)
MenuIDNO[MenuIDNO.length] = i + 1;
return MenuIDNO;
}
-->
</script>

</head>
<body>

<form name="formName" action="array_test.htm">
<select name="selectName" size="5">
<option value="3">1-3-Our Mission</option>
<option value="5">2-5-Team Contact List</option>
<option value="4">3-4-Organization Charts</option>
<option value="6">4-6-Marketing Ops Recogniton</option>
<option value="7">5-7-Spirit of Excellence</option>
</select>

<input type="button" value="up"
onclick="moveSelected(this.form.selectName, false);">
<input type="button" value="down"
onclick="moveSelected(this.form.selectName, true);">
</form> 

</body>
</html>



Thank you,

> Issac Rosa
> 
> IT - National Sales & Marketing
> Analyst/Web Developer
> Ofc: 407-658-3111
> Cell: 407-342-0644
> Fax: 407-971-2374
> [EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to