0

jQueryフォームプラグインjQueryValidateプラグインを一緒に使用しようとしていますが、必須フィールドが空白の場合でも、フォームはAJAXで送信されます。これが私のコードです:

// prepare the form when the DOM is ready 
$(document).ready(function() { 

     // bind form using ajaxForm 
     $('#contact-form').ajaxForm({ 
    // target identifies the element(s) to update with the server response 
    target: '#ajax-success', 

    // success identifies the function to invoke when the server response 
    // has been received; here we apply a fade-in effect to the new content 
    success: function() { 
        $('#contact-form-wrapper').hide();
        $('#ajax-success').fadeIn('slow'); 
    } 
    }); 
});
4

1 に答える 1

0

検証プラグインのドキュメントには、これを行う方法が示されています。

関数を見てくださいsubmitHandler

于 2012-04-23T15:44:38.267 に答える