Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When using Drupal's integer field with a maximum value set, the values are compared as strings instead of numbers. The JS inserted into the head tag has the maximum values quoted.
I've been able to workaround this by updating the local jquery.validate.js file as follows:
--- a/jquery.validate/dist/jquery.validate.js
+++ b/jquery.validate.orig/dist/jquery.validate.js
@@ -1226,7 +1226,7 @@ $.extend( $.validator, {
// http://jqueryvalidation.org/max-method/
max: function( value, element, param ) {
- return this.optional( element ) || Number(value) <= Number(param);
+ return this.optional( element ) || value <= param;
},
// http://jqueryvalidation.org/range-method/
It would seem to work without this modification if the values sent to the jQuery Validations max method were not quoted.
Comments
Comment #1
Jelle_SFixed in latest dev.