I've seen many solutions over this question. But any of this doesn't solve my problem. When i use:
$("form#sending-notice-form").unbind('submit').bind('submit', function (e) {
e.preventDefault();
..
});
Then, form submit once but my form validation library doesn't work. When i use:
$("form#sending-notice-form").submit(function (e) {
e.preventDefault();
..
});
OR
$("form#sending-notice-form").on("submit", function (e) {
e.preventDefault();
..
});
Then, Validation library work fine but form submit multiple times. When i use:
$("form#sending-notice-form").submit(function (e) {
$(this).unbind("submit");
e.preventDefault();
..
});
Then, Validation library work for first submit. when submit twice or double click the submit button then open form ACTION url in the browser.
答案 0 :(得分:0)
尝试使用<html>
<head>
<title></title>
</head>
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "https://connect.facebook.net/nl_NL/sdk.js#xfbml=1&version=v2.8";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-page" data-href="https://www.facebook.com/facebook" data-tabs="timeline" data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true"><blockquote cite="https://www.facebook.com/facebook" class="fb-xfbml-parse-ignore"><a href="https://www.facebook.com/facebook">Facebook</a></blockquote></div>
</body>
</html>
:
.on()
答案 1 :(得分:0)
尝试一次..
jQuery("form#sending-notice-form").submit(function (e) {
if (jQuery("#conatct_form_id").valid()) {
// Code
e.preventDefault();
return false;
}
});
我希望它对你有帮助.....