Bug Tracker

Ticket #2633 (closed bug: invalid)

Opened 5 months ago

Last modified 3 months ago

JQuery Validator function bug

Reported by: xfactor973 Assigned to: anonymous
Type: bug Priority: major
Milestone: 1.2.4 Component: plugin
Version: 1.2.3 Keywords:
Cc: Needs: Review

Description (last modified by davidserduke) (diff)

I created a function that is added to the validator. The function is:

		$.validator.addMethod("greaterThan",function(value,element,param){
			min = jQuery(param).val();
			max = value;
			confirm('min: ' + min);
			confirm('max: ' + max);
			confirm(min < max);
			return min < max;
		},"Please make sure the maximum price is greater than the minimum price");

The values are being pulled from a select list. When the min is equal to 99999 and the max is 125000 it returns true that the min is greater than the max. Any idea why this is happening? For all other values it works as expected.

Attachments

example.html (4.0 kB) - added by xfactor973 5 months ago.
Quick example

Change History

Changed 5 months ago by xfactor973

Quick example

Changed 5 months ago by davidserduke

  • owner deleted
  • component changed from core to plugin
  • description changed from I created a function that is added to the validator. The function is: $.validator.addMethod("greaterThan",function(value,element,param){ min = jQuery(param).val(); max = value; confirm('min: ' + min); confirm('max: ' + max); confirm(min < max); return min < max; },"Please make sure the maximum price is greater than the minimum price"); The values are being pulled from a select list. When the min is equal to 99999 and the max is 125000 it returns true that the min is greater than the max. Any idea why this is happening? For all other values it works as expected. to I created a function that is added to the validator. The function is: {{{ $.validator.addMethod("greaterThan",function(value,element,param){ min = jQuery(param).val(); max = value; confirm('min: ' + min); confirm('max: ' + max); confirm(min < max); return min < max; },"Please make sure the maximum price is greater than the minimum price"); }}} The values are being pulled from a select list. When the min is equal to 99999 and the max is 125000 it returns true that the min is greater than the max. Any idea why this is happening? For all other values it works as expected.

Changed 3 months ago by joern

  • status changed from new to closed
  • resolution set to invalid

Can't reproduce that. Also, this isn't a problem with the validation plugin.

Note: See TracTickets for help on using tickets.