我使用jQuery驗證插件,我也使用jQuery做了一個彈出窗口,我的形式是在一個封閉的動畫。自然的行爲jQuery的只有形式是有效
,我不想彈出窗口關閉,如果窗體無效並且錯誤需要修復。
這裏就是我的工作......
表單驗證:
$(document).ready(function(){
$("#form").validate({
errorContainer: "#messageBox1",
errorLabelContainer: "#messageBox1 ul",
wrapper: "li",
});
});
提交表單按鈕動作:
$("#ContinueButton").click(function(){
$("#refer-a-friend").animate({
top: "0%",
opacity: 0
}, 500);
});
那麼我將如何使它所以關閉動畫只有在表格有效時纔會觸發?