Skip to content

Commit 2f6d3d9

Browse files
JonyJony
Jony
authored and
Jony
committed
Now you can use the "showmsg" event to do the same thing as the "showMsg" method.
1 parent f6eb1b0 commit 2f6d3d9

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/jquery.validator.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -782,13 +782,18 @@
782782
var me = this,
783783
el = e.target;
784784

785-
if ( $(el).is(INPUT_SELECTOR) ) {
786-
me.showMsg(el, {type: type, msg: msg});
785+
if ( me.$el.is(el) ) {
786+
if (isObject(type)) {
787+
me.showMsg(type)
788+
}
789+
else if ( type === 'tip' ) {
790+
me.$el.find(INPUT_SELECTOR +"["+ DATA_TIP +"]", el).each(function(){
791+
me.showMsg(this, {type: type, msg: msg});
792+
});
793+
}
787794
}
788-
else if ( type === 'tip' ) {
789-
me.$el.find(INPUT_SELECTOR +"["+ DATA_TIP +"]", el).each(function(){
790-
me.showMsg(this, {type: type, msg: msg});
791-
});
795+
else {
796+
me.showMsg(el, {type: type, msg: msg});
792797
}
793798
},
794799

0 commit comments

Comments
 (0)