Skip to content

Commit c699f7a

Browse files
committed
fixed #255
1 parent 42a95a3 commit c699f7a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/jquery.validator.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,7 @@
11551155
tgt = isFunction(tgt) ? tgt.call(this, el) : this.$el.find(tgt);
11561156
if (tgt.length) {
11571157
if ( tgt.is(INPUT_SELECTOR) ) {
1158+
$el = tgt
11581159
el = tgt.get(0);
11591160
} else if ( tgt.hasClass(CLS_MSG_BOX) ) {
11601161
$msgbox = tgt;
@@ -1173,8 +1174,6 @@
11731174

11741175
// Create new message box
11751176
if (!msgOpt.hide && !$msgbox.length) {
1176-
$el = this.$el.find(tgt || el);
1177-
11781177
$msgbox = $('<'+ msgOpt.wrapper + '>').attr({
11791178
'class': CLS_MSG_BOX + (msgOpt.cls ? ' ' + msgOpt.cls : ''),
11801179
'style': msgOpt.style || undefined,
@@ -1229,7 +1228,7 @@
12291228
}
12301229

12311230
msgOpt = me._getMsgOpt(msgOpt, field);
1232-
el = $(el).get(0);
1231+
el = (el.name && _checkable(el) ? me.$el.find('input[name="'+ el.name +'"]') : $(el)).get(0);
12331232

12341233
// ok or tip
12351234
if (!msgOpt.msg && msgOpt.type !== 'error') {

0 commit comments

Comments
 (0)