We are using javascript, menu swapper - select some items in the left box, click the arrow button, the items go to the right box; or the same the other way for unselect) in a cold fusion page.
After we select tiems into the right box, the page goes to the action page with the "insert" query to insert the selected values into the database.
The problem is the value doesn't pass over to the action page. This is the error
"The specified form field cannot be found. This problem is very likely due to the fact that you have misspelled the form field name."
Please help!!!
Thanks.
------------------------------------------------------------
The following is the Java Script
<SCRIPT LANGUAGE="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.text] = tbox.options.value;
arrTbox = tbox.options.text;
}
var fLength = 0;
var tLength = arrTbox.length;
for(i = 0; i < fbox.options.length; i++) {
arrLookup[fbox.options.text] = fbox.options.value;
if (fbox.options.selected && fbox.options.value != ""
{
arrTbox[tLength] = fbox.options.text;
tLength++;
}
else {
arrFbox[fLength] = fbox.options.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;
}
}
</script>
------------------------------------------------------------
The following (menu swapper) is in Cold Fusion form page.
The left box with all items listed --
<CFSELECT NAME="usused_states" SIZE="3" QUERY="unused_states" VALUE="stateid" DISPLAY="FullName" multiple="Yes"></CFSELECT>
The middle arrow buttons --
<input type="button" onClick="move(this.form.usused_states,this.form.states)" value=" >> ">
<input type="button" onClick="move(this.form.states,this.form.usused_states)" value=" << ">
The right box with no item selected originally --
<CFSELECT NAME="states" SIZE="3" VALUE="StateID" DISPLAY="FullName" MULTIPLE></CFSELECT>
After we select tiems into the right box, the page goes to the action page with the "insert" query to insert the selected values into the database.
The problem is the value doesn't pass over to the action page. This is the error
"The specified form field cannot be found. This problem is very likely due to the fact that you have misspelled the form field name."
Please help!!!
Thanks.
------------------------------------------------------------
The following is the Java Script
<SCRIPT LANGUAGE="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.text] = tbox.options.value;
arrTbox = tbox.options.text;
}
var fLength = 0;
var tLength = arrTbox.length;
for(i = 0; i < fbox.options.length; i++) {
arrLookup[fbox.options.text] = fbox.options.value;
if (fbox.options.selected && fbox.options.value != ""
arrTbox[tLength] = fbox.options.text;
tLength++;
}
else {
arrFbox[fLength] = fbox.options.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;
}
}
</script>
------------------------------------------------------------
The following (menu swapper) is in Cold Fusion form page.
The left box with all items listed --
<CFSELECT NAME="usused_states" SIZE="3" QUERY="unused_states" VALUE="stateid" DISPLAY="FullName" multiple="Yes"></CFSELECT>
The middle arrow buttons --
<input type="button" onClick="move(this.form.usused_states,this.form.states)" value=" >> ">
<input type="button" onClick="move(this.form.states,this.form.usused_states)" value=" << ">
The right box with no item selected originally --
<CFSELECT NAME="states" SIZE="3" VALUE="StateID" DISPLAY="FullName" MULTIPLE></CFSELECT>