to 1楼的大哥 这些代码在加到哪呢?提交数据判断函数是指哪个?function Test( lbFieldsSelect,value) { for (j = 0;j<lbFieldsSelect.length; j++) { if (lbFieldsSelect.options[j].value == value) return true; } return false; }
function SelectField() { var lst1=window.document.getElementById("lstBoxLeft"); var lstindex=lst1.selectedIndex; if(lstindex<0) return; var v = lst1.options[lstindex].value; var t = lst1.options[lstindex].text; var lst2=window.document.getElementById("lstBoxRight"); if (Test(lst2,v)) { return; } lst2.options[lst2.options.length] = new Option(t,v,true,true); lst1.options[lstindex].parentNode.removeChild(lst1.options[lstindex]);
再提交数据判断函数里面加上
var potlists = '';
for(ix=0; ix<frmProg.listbox2.length; ix++)
{
potlists += frmProg.listbox2.options[ix].value + ",";
}
frmProg.hdnPotList.value = potlists.substring(0, potlists.length-1);
//这里frmProg只所在的form名称
后台获取hdnPotList.Value 就可以了
把你的listbox2中被选中的数据存放到一个隐藏的text中,在后台取隐藏的text中的值就可以了
这些代码在加到哪呢?提交数据判断函数是指哪个?function Test( lbFieldsSelect,value)
{
for (j = 0;j<lbFieldsSelect.length; j++)
{
if (lbFieldsSelect.options[j].value == value) return true;
}
return false;
}
function SelectField()
{
var lst1=window.document.getElementById("lstBoxLeft");
var lstindex=lst1.selectedIndex;
if(lstindex<0)
return;
var v = lst1.options[lstindex].value;
var t = lst1.options[lstindex].text;
var lst2=window.document.getElementById("lstBoxRight");
if (Test(lst2,v))
{
return;
}
lst2.options[lst2.options.length] = new Option(t,v,true,true);
lst1.options[lstindex].parentNode.removeChild(lst1.options[lstindex]);
}