我有一个简单的表格:jQuery验证不点火submitHandler
<form method="post" action="/home/keepintouch" id="stay-in-touch">
<div>
<label for="email">Stay in touch</label>
<input type="text" value="enter your email address" title="Keep up-to-date with new products, services, news and special offers." size="20" name="email" id="email" class="off field required email">
<input type="image" src="/content/images/contact-arrow.png" name="intouch-submit" class="imgbtn">
</div>
</form>
在我的网页,我包括以下几个JS文件:
在我脚本文件我这样做:
// contact form.
$('#stay-in-touch').validate({
submitHandler: function (form) {
$(form).ajaxSubmit({
success: function (response, status, xhr, form) {
$('#stay-in-touch div').fadeOut('slow', function() {
$('#stay-in-touch').append('<div class="msg">' + response.msg + '</div>');
});
}
});
return false;
}
});
但submitHandler不会触发。
任何想法?
我试着在submitHandler里放置一个ALERT(..),但没有喜悦。映射验证的代码肯定正在运行。
你可以看到现场代码在这里:
.ajaxsubmit()是一种形式的插件..有你还说,你的HTML – 2011-06-02 11:22:18