Skip to content

Commit 5459712

Browse files
committed
Avoid trailing <br/> in prompt
1 parent 22e5929 commit 5459712

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

js/jquery.validationEngine.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,10 @@
730730

731731
//funcCallRequired, first in rules, and has error, skip anything else
732732
if( i==0 && str.indexOf('funcCallRequired')==0 && errorMsg !== undefined ){
733-
promptText += errorMsg + "<br/>";
733+
if(promptText != '') {
734+
promptText += "<br/>"
735+
}
736+
promptText += errorMsg;
734737
options.isError=true;
735738
field_errors++;
736739
end_validation=true;
@@ -743,7 +746,10 @@
743746

744747
// If we have a string, that means that we have an error, so add it to the error message.
745748
if (typeof errorMsg == 'string') {
746-
promptText += errorMsg + "<br/>";
749+
if(promptText != '') {
750+
promptText += "<br/>"
751+
}
752+
promptText += errorMsg;
747753
options.isError = true;
748754
field_errors++;
749755
}

0 commit comments

Comments
 (0)