我的代码:
<form method="post" action="PreDischargeEducation.aspx" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__LASTFOCUS" id="__LASTFOCUS" value="" />
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/lots of stuff here" />
</div>
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>
<div class="aspNetHidden">
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBgKblbSKDQLWxZaxDwK+n5yTDgKN97n9CAL1m+DgCwKZseiDBoE7ceDrS0JTSg/qHRKRiCdcZ+nF2M69ovt+U0TvDhOh" />
</div>
然后在底部我有
<a class="box" href="javascript:document.forms[0].submit()">Submit & Continue...</a>
但是,按钮不走。表单[0] 在 IE10 中不可用吗?
另外,当我在字段中使用 Return 键提交时,数据似乎没有进入后端 ASP.NET 代码。我的 JavaScript 不好吗?在其他浏览器中运行良好。
编辑:标签在真实代码之后。