【发布时间】:2012-10-10 03:12:24
【问题描述】:
这是我的代码:
function checkupload(){
if(upload == false)
{
alert("Please upload a file");
return false;
}
(...)
$('#download_form').submit();
alert('submitted');
}
My HTML:
<form action="http://localhost/rendu/download.php" method="post" id="download_form">
<input type="hidden" name="57" id="in_57"/>
<input type="hidden" name="72" id="in_72"/>
<input type="hidden" name="png" id="in_png"/>
<input type="hidden" name="ico" id="in_ico"/>
<a onclick='checkupload()'><img src="images/download_normal.png" onmouseover="mover()" onmouseout="mout()"/></a>
</form>
无论我做什么,表单都不会被提交。我查看了请求,并没有向 download.php 页面发送请求,但显示了警报消息。
我错过了什么? 谢谢。
【问题讨论】:
-
它在前面的代码中定义。控制台没有错误。
-
jsfiddle from cljk answer below ( jsfiddle.net/FXd8p ) 复制您的代码,并提交表单。所以肯定还有其他我们不知道的东西。
-
我使用的是 Google Chrome 版本 23.0.1255.0 (154635)