日期:2014-05-17  浏览次数:20769 次

急:求助:关于无组件上传时复选框取值?
我在表单中有:
<form   name= "myform "   method= "post "   action= "car_DealersSort_Save.asp "   onSubmit= "return   CheckForm(); "   enctype= "multipart/form-data ">  
               
<input   name= "mertype_State "   type= "checkbox "   value= "0301 "> 博克斯特
<input   name= "mertype_State "   type= "checkbox "   value= "0302 "> 卡曼
<input   name= "mertype_State "   type= "checkbox "   value= "0303 "> 911
<input   name= "mertype_State "   type= "checkbox "   value= "0304 "> 卡雷拉GT
<input   name= "mertype_State "   type= "checkbox "   value= "0305 "> 卡宴  

<input   type= "file "   name= "lianjie "   size= "50 "> 上传图片    
</form>  
   
在接收程序(car_DealersSort_Save.asp)中:
rs( "mertype_Structure ")=upload.form( "mertype_Structure ")

为何只选中一个的时候有值,多选就没有值了?如何取得多选框的值?
麻烦各位同仁指教,谢谢!

------解决方案--------------------
response.write( upload.form( "mertype_Structure ")) 看看是啥?
------解决方案--------------------
应该会有0301,0302这样的值的吧?
------解决方案--------------------
mertype_Structure 字段大小、数据类型?
------解决方案--------------------
<input name= "mertype_State " type= "checkbox " value= "0301 " onclick= "SetSelectValue() "> 博克斯特
<input name= "mertype_State " type= "checkbox " value= "0302 " onclick= "SetSelectValue() "> 卡曼
<input name= "mertype_State " type= "checkbox " value= "0303 " onclick= "SetSelectValue() "> 911
<input name= "mertype_State " type= "checkbox " value= "0304 " onclick= "SetSelectValue() "> 卡雷拉GT
<input name= "mertype_State " type= "checkbox " value= "0305 " onclick= "SetSelectValue() "> 卡宴
<input name= "ClloectState " id= "ClloectState " type= "hidden "/>
<script>
function SetSelectValue()
{
var str = " ";
var arrState = document.getElementsByName( "mertype_State ");
for (var i=0;i <arrState.length;i++)
{
if (arrState[i].checked)
{
if (str == " " )
str = arrState[i].value;
else
str += ", " + arrState[i].value;
}
}
document.getElementById( "ClloectState ").value = str;
}
</script>

upload.form( "ClloectState ")
------解决方案--------------------
upload.form( "ClloectState ")返回的是用“,”隔开的字符串
------解决方案--------------------
<input name= "mertype_State1 " type= "checkbox " value= "0301 "> 博克斯特
<input name= "mertype_State2 " type= "checkbox " value= "0302 "> 卡曼
<input name= "mertype_State3 " type= "checkbox " value= "0303 "> 911
<input name= "mertype_State4 " type= "checkbox " value= "0304 "> 卡雷拉GT