diff --git a/src/core.js b/src/core.js index 776d3647c..806694c69 100644 --- a/src/core.js +++ b/src/core.js @@ -608,9 +608,10 @@ $.extend($.validator, { // return the custom message for the given element and validation method // specified in the element's HTML5 data attribute + // return the generic message if present and no method specific message is present customDataMessage: function( element, method ) { - return $( element ).data( "msg" + method[ 0 ].toUpperCase() + method.substring( 1 ).toLowerCase() ); - + return $( element ).data( "msg" + method[ 0 ].toUpperCase() + + method.substring( 1 ).toLowerCase() ) || $( element ).data("msg"); }, // return the custom message for the given element name and validation method diff --git a/test/index.html b/test/index.html index b2f5d8249..f47e8d4eb 100644 --- a/test/index.html +++ b/test/index.html @@ -137,6 +137,7 @@