File tree 1 file changed +10
-3
lines changed 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 328
328
errorFound |= methods . _validateField ( field , options ) ;
329
329
if ( errorFound && first_err == null )
330
330
if ( field . is ( ":hidden" ) && options . prettySelect )
331
- first_err = field = form . find ( "#" + options . usePrefix + field . attr ( 'id' ) + options . useSuffix ) ;
331
+ first_err = field = form . find ( "#" + options . usePrefix + methods . _jqSelector ( field . attr ( 'id' ) ) + options . useSuffix ) ;
332
332
else
333
333
first_err = field ;
334
334
if ( options . doNotShowAllErrosOnSubmit )
689
689
}
690
690
691
691
if ( field . is ( ":hidden" ) && options . prettySelect ) {
692
- field = form . find ( "#" + options . usePrefix + field . attr ( 'id' ) + options . useSuffix ) ;
692
+ field = form . find ( "#" + options . usePrefix + methods . _jqSelector ( field . attr ( 'id' ) ) + options . useSuffix ) ;
693
693
}
694
694
695
695
if ( options . isError ) {
1794
1794
if ( className )
1795
1795
return className . replace ( / : / g, "_" ) . replace ( / \. / g, "_" ) ;
1796
1796
} ,
1797
-
1797
+ /**
1798
+ * Escape special character for jQuery selector
1799
+ * http://totaldev.com/content/escaping-characters-get-valid-jquery-id
1800
+ * @param {String } selector
1801
+ */
1802
+ _jqSelector : function ( str ) {
1803
+ return str . replace ( / ( [ ; & , \. \+ \* \~ ' : " \! \^ # $ % @ \[ \] \( \) = > \| ] ) / g, '\\$1' ) ;
1804
+ } ,
1798
1805
/**
1799
1806
* Conditionally required field
1800
1807
*
You can’t perform that action at this time.
0 commit comments