0
后不提交表单
我想设置的延迟,当用户点击表单提交,提交前..我有一个显示测试点击事件的图像,并能正常工作,但形式也从未提交....submit()setTimeout的
这里是我的HTML表单:
<form class='loginForm1' action='verify_credentials.php' method='post'>
<fieldset>
<legend>Log into Answer Tree</legend>
<label>Username</label>
<input class='inputs' name='username' type="text" placeholder="Enter username...">
<label>Password</label>
<input class='inputs' name='password' type="text" placeholder="Enter password...">
<label class="checkbox">
<input type="checkbox">Remember me</label>
<button id='submit' type='button' class="btn btn-success">Submit</button>
</fieldset>
</form>
这里是脚本:
$(document).ready(function() {
$(".containerLogin img").hide();
});
$(function() {
$("#submit").click(function() {
$(".containerLogin img").show();
setTimeout(submitForm, 1000);
});
});
function submitForm() {
$(".loginForm1").submit();
}
我得到这个错误信息:
Uncaught TypeError: Property 'submit' of object #<HTMLFormElement> is not a function
好,'.delay(2000)$(”。loginForm1' )'是一个错误的语法,和二,.delay()只延迟动画。您应该按照问题标题中的建议使用setTimeout。 – 2013-03-03 05:48:07
您有两个开始'
srry添加了错误的代码...这是我一直在 – 2013-03-03 05:52:35