2016-11-07 58 views
4

我正在使用窗體的引導驗證。 這工作正常,除了一個問題。重置或清除BootStrap驗證消息,當我們打開和關閉彈出窗口

沒有在文字輸入任何內容,如果保存點擊,它顯示驗證消息,請點擊關閉按鈕, 重啓模態,它最初顯示驗證消息

$('#taginsertform').bootstrapValidator(
{ 
     feedbackIcons: 
     { 
       valid: 'glyphicon glyphicon-ok', 
       invalid: 'glyphicon glyphicon-remove', 
       validating: 'glyphicon glyphicon-refresh' 
     }, 
     fields: 
     { 
       recipientname: 
       { 
         feedbackIcons: 'false', 
         validators: 
         { 
           notEmpty: 
           { 
             message: 'Reciepnt Name cannot be empty' 
           } 
         } 
       } 
     } 
}).on('success.form.bv', function(e) 
{ 
     e.preventDefault(); 
     addTagSbmt(); 
}); 

這是我的小提琴

http://jsfiddle.net/xmrxbL9f/74/

回答

3

嘗試更換事件

shown.bs.modal 

hide.bs.modal 

所以當用戶正在關閉模式,而不是在openinig驗證錯誤得到清除。

See this fiddle

相關問題