var loSelect=document.getElementById("Select1"); var lnlength=loSelect.options.length; var values; for(var i=0;i<lnlength;i++) { values+=loSelect.options[i].value; }
------解决方案-------------------- 1.用HIDDEN控件 2.使用ASP控件DropDownList
------解决方案--------------------
JScript code
window.onload=function(){
var loSelect=document.getElementById("Select1");
var lnlength=loSelect.options.length;
var values;
for(var i=0;i <lnlength;i++)
{
values+=loSelect.options[i].value;
}
document.getElementById('ct100_hidden').value=values; //用hidden控件保存 post上去
}
------解决方案--------------------
var loSelect=document.getElementById("Select1"); var lnlength=loSelect.options.length; var values; for(var i=0;i <lnlength;i++) { values+=','+loSelect.options[i].value; } document.getElementById("hidValue").value=values;