Skip to content

Commit 63f4e07

Browse files
committed
Merge pull request #508 from adriangrigore/master
Added 'showPrompts' option to enable/disable prompts.
2 parents f9a4ae8 + f4374ef commit 63f4e07

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

js/jquery.validationEngine.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@
453453
if (txt)
454454
msg = txt;
455455
}
456-
methods._showPrompt(errorField, msg, "pass", false, options, true);
456+
if (options.showPrompts) methods._showPrompt(errorField, msg, "pass", false, options, true);
457457
}
458458
} else {
459459
// the field is invalid, show the red error prompt
@@ -463,7 +463,7 @@
463463
if (txt)
464464
msg = txt;
465465
}
466-
methods._showPrompt(errorField, msg, "", false, options, true);
466+
if(options.showPrompts) methods._showPrompt(errorField, msg, "", false, options, true);
467467
}
468468
}
469469
}
@@ -694,7 +694,7 @@
694694
field = form.find("#" + options.usePrefix + methods._jqSelector(field.attr('id')) + options.useSuffix);
695695
}
696696

697-
if (options.isError){
697+
if (options.isError && options.showPrompts){
698698
methods._showPrompt(field, promptText, promptType, false, options);
699699
}else{
700700
if (!isAjaxValidator) methods._closePrompt(field);
@@ -1385,7 +1385,7 @@
13851385
else
13861386
msg = rule.alertText;
13871387

1388-
methods._showPrompt(errorField, msg, "", true, options);
1388+
if (options.showPrompts) methods._showPrompt(errorField, msg, "", true, options);
13891389
} else {
13901390
options.ajaxValidCache[errorFieldId] = true;
13911391

@@ -1401,11 +1401,13 @@
14011401
else
14021402
msg = rule.alertTextOk;
14031403

1404-
// see if we should display a green prompt
1405-
if (msg)
1406-
methods._showPrompt(errorField, msg, "pass", true, options);
1407-
else
1408-
methods._closePrompt(errorField);
1404+
if (options.showPrompts) {
1405+
// see if we should display a green prompt
1406+
if (msg)
1407+
methods._showPrompt(errorField, msg, "pass", true, options);
1408+
else
1409+
methods._closePrompt(errorField);
1410+
}
14091411

14101412
// If a submit form triggered this, we want to re-submit the form
14111413
if (options.eventTrigger == "submit")
@@ -1885,6 +1887,8 @@
18851887
scroll: true,
18861888
// Focus on the first input
18871889
focusFirstField:true,
1890+
// Show prompts, set to false to disable prompts
1891+
showPrompts: true,
18881892
// Opening box position, possible locations are: topLeft,
18891893
// topRight, bottomLeft, centerRight, bottomRight
18901894
promptPosition: "topRight",

0 commit comments

Comments
 (0)