我有这样的HTML表单IE 11不能提交HTML表单
<form name="nextform" action="anotherpage.php" method="post" enctype="multipart/form-data">
<input name="pinid" id="pinid" type="hidden">
<input type="submit" name="submit" id="post" value="Lets Go" class="formButtonMap">
</form>
pinid
动态获取使用JavaScript的值。当它得到一个值时,我会提醒它,它会起作用。
但是,当我点击Lets Go
按钮时,没有任何反应。我看到Internet Explorer加载了几分钟,然后收到消息“网页无响应”。如果我点击刷新,则转到anotherpage.php
,但表单中的值未到达服务器。
很少显示出这样的信息:
的Visual Studio刚刚在实时调试
未处理的win32异常在IEXPLORER.EXE [688]
可能发生的调试器:
Microsoft Visual Studio 2012新实例
此行为仅在Internet Explorer 11.0.2中可见。该表单适用于旧版本的Internet Explorer以及Chrome和Firefox。 IE的控制台没有错误。
这里是JavaScript代码,放置在窗体以上:
// called when another button is clicked - basicaly is websockets
function save() {
var so = new WebSocket("ws://localhost:8000");
so.onerror = function (evt) {
alert('problem');
}
if (sara == 'LINES') {
so.onopen = function() {
so.send(JSON.stringify({
command: 'insertAll',
name: document.getElementById('name').value
}));
}
}
if (sara == 'POLY') {
so.onopen = function() {
so.send(JSON.stringify({
command: 'insertHalf',
name: document.getElementById('name').value
}));
}
}
so.onmessage = function (evt) {
var received_msg = evt.data;
document.getElementById("next").style.display = "block";
document.getElementById("name").value = "";
document.getElementById("descr").value = "";
clearLinks();
document.getElementById("pinid").value = received_msg;
alert(document.getElementById("pinid").value); // works
so.close();
}
}
我尝试编辑使用document.getElementById("nextform").submit();
的代码,问题仍然存在。
是我吗?这是一个错误吗?我错过了什么?
为什么你需要提交输入值? – w3jimmy
@ w3jimmy这是用户看到的文本的“名称”。它可能是“下载”或“返回”。你建议我应该删除它? – slevin
你的网页实际上发布了,如果你看到,所以问题似乎不是按钮本身。重定向页面可能有问题吗? – Kuzgun