今天碰到了一个非常郁闷的问题,有一个表单,在数据少的时候提交正常.
但是叫给用户后,发现点提交按钮没有任何反映了,
测试后发现,当数据大于1400的时候开始表单不提交。
代码事这样的:
< form id ="form1" name ="form1" action ="append_wySel_save.asp" onSubmit ="return checkForm();" > checkForm:function checkForm(){ if(document.getElementById("attWy_list").length>0){ setSelectToInput("attWy_list","selectedWy") //alert(document.getElementById("selectedWy").value) }else{ document.getElementById("selectedWy").value=""; } return true;}function setSelectToInput(selName,InpName){ var selectObj=document.getElementById(selName); var id; id=""; var tmp; for(var i=0;i < selectObj .length;i++){ tmp =selectObj.options[i].value.split("|"); id+ ="," +tmp[0]; } if(id.length > 0) id+=","; document.getElementById(InpName).value=id; }
好像没有什么逻辑的错误,毕竟document.getElementById("selectedWy") 长度小于1400的时候一切正常
郁闷了半天,资料也找了不少,就是没有说,为什么表单不响应的。
突然想起,如果表单通过get方法提交,数据量是受限的,于是发现了,我的form没有指定method="post"
而在IE中默认是通过GET提交数据的,
于是修改代码
<form id="form1" name="form1" action="append_wySel_save.asp" method="post" onSubmit="return checkForm();">
提交终于正常了
总结:如果遇到表单提交小数据正常,而提交大数据量的信息是不响应,一般先检查form的标签,时候有指定method="post" 可能大于1000的,应该指post,除非特殊情况,
当表单的总数据量>1500的时候,IE将不响应GET方式的表单提交动作