jQuery Validation Plugin을 사용 중입니다. 제출 버튼을 한 번 더 클릭하면 성공 메시지 알림에 한 번 더 표시됩니다. 제출 버튼을 여러 번 클릭하는 것을 방지하려면 어떻게해야합니까?jQuery 유효성 검사 플러그인에서 복수 제출을 사용하지 않음
$(document).ready(function() {
$('#contact-us').validate({
rules: {
cName: 'required',
email: 'required',
cText: 'required'
},
messages: {
cName: '<?php echo $errorName; ?>',
email: '<?php echo $errorEmail; ?>',
cText: '<?php echo $errorComment; ?>'
},
submitHandler: function(form) {
var formInput = $(this).serialize();
$.post($(this).attr('action'), formInput, function(data){
$('#contact-us').fadeOut('fast', function(){
$(this).before($('<p class="alert alert-success"><?php _e('Your message was sent successfully. Thanks!'); ?></p>').fadeIn('fast'));
});
});
}
});
});
당신의 시간을 가지고 가지고 http://try.jquery.com :)에 통과 – Lenin