SA Heat
11-01-2003, 03:12 AM
I have been trying to figure this out for ages and can't do it. I have a menue swap box. It has two boxes, the one on the left has 12 names in it, the one on the right has none. It has a add button and a remove button which takes the selected names and puts the one you select into the box on the right, the empty one. Now I want to add submit button to where when a user selects some names and then hits submits, it will save it that way. Ex: I select 4 names out of the 12 and hit submit, I want it to save the 4 names I selected and keep it that way, when ever you open the page up again it is saved the way, You see I want to put it on the web and have a user select any names he wants from the box and saves it somehow. Here is the code I am working with and tried many times to add tags to make it work, I give up , I need help!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<FORM
action=http://www.mysite.com/empire/wwffl/cgi-bin/script_library/form_handler_file
method=post>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<SCRIPT language=JavaScript>
<!-- Begin
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>
<META content="MSHTML 6.00.2726.2500" name=GENERATOR></HEAD>
<BODY><FORM name="combo_box">
<TABLE>
<TBODY>
<TR>
<TD><SELECT style="WIDTH: 150px" multiple size=10 name=list1> <OPTION
value=12>Alabama</OPTION> <OPTION value=54>Alaska</OPTION> <OPTION
value=65>Arizona</OPTION> <OPTION value=45 selected>Arkansas</OPTION>
<OPTION value=2>California</OPTION> <OPTION value=6>Colorado</OPTION>
<OPTION value=81>Connecticut</OPTION> <OPTION value=5>Delaware</OPTION>
<OPTION value=23>District of Columbia</OPTION> <OPTION
value=58>Florida</OPTION> <OPTION value=87>Georgia</OPTION> <OPTION
value=98>Hawaii</OPTION></SELECT> </TD>
<TD vAlign=center align=middle><INPUT onclick=move(this.form.list2,this.form.list1) type=button value="<<">
<INPUT onclick=move(this.form.list1,this.form.list2) type=button value=">>">
</TD>
<TD><SELECT style="WIDTH: 150px" multiple size=10 name=list2></SELECT>
</TD></TR></TBODY></TABLE></FORM><INPUT type=hidden
value=http://www.mysite.com/empire/wwffl/dynastyindex.htm
name=end_display><INPUT type=hidden
value="" name=order> <INPUT
type=hidden value=changes.htm name=savefile> <INPUT type=hidden
value=MyEmail.net name=email_to> <INPUT type=submit value=Submit onClick="Savefile" </P></FORM>
<P>
<P><!-- Script Size: 4.75 KB --></P></BODY></HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<FORM
action=http://www.mysite.com/empire/wwffl/cgi-bin/script_library/form_handler_file
method=post>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<SCRIPT language=JavaScript>
<!-- Begin
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>
<META content="MSHTML 6.00.2726.2500" name=GENERATOR></HEAD>
<BODY><FORM name="combo_box">
<TABLE>
<TBODY>
<TR>
<TD><SELECT style="WIDTH: 150px" multiple size=10 name=list1> <OPTION
value=12>Alabama</OPTION> <OPTION value=54>Alaska</OPTION> <OPTION
value=65>Arizona</OPTION> <OPTION value=45 selected>Arkansas</OPTION>
<OPTION value=2>California</OPTION> <OPTION value=6>Colorado</OPTION>
<OPTION value=81>Connecticut</OPTION> <OPTION value=5>Delaware</OPTION>
<OPTION value=23>District of Columbia</OPTION> <OPTION
value=58>Florida</OPTION> <OPTION value=87>Georgia</OPTION> <OPTION
value=98>Hawaii</OPTION></SELECT> </TD>
<TD vAlign=center align=middle><INPUT onclick=move(this.form.list2,this.form.list1) type=button value="<<">
<INPUT onclick=move(this.form.list1,this.form.list2) type=button value=">>">
</TD>
<TD><SELECT style="WIDTH: 150px" multiple size=10 name=list2></SELECT>
</TD></TR></TBODY></TABLE></FORM><INPUT type=hidden
value=http://www.mysite.com/empire/wwffl/dynastyindex.htm
name=end_display><INPUT type=hidden
value="" name=order> <INPUT
type=hidden value=changes.htm name=savefile> <INPUT type=hidden
value=MyEmail.net name=email_to> <INPUT type=submit value=Submit onClick="Savefile" </P></FORM>
<P>
<P><!-- Script Size: 4.75 KB --></P></BODY></HTML>