Bug Tracker

Modify

Ticket #2230 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

[validate] custom messages are lost when min/max are converted to range

Reported by: Romirez Owned by: joern
Priority: major Milestone: 1.2.3
Component: plugin Version: 1.2.2
Keywords: validate Cc:
Blocking: Blocked by:

Description

The code in the validate 1.2 plugin that converts the minlength and maxlength to rangelength (and min and max to range) ignores the fact that these rules may have error messages associated with them, and defaults to the standard range error message instead of using them.

I'm not quite sure what the purpose of that code is anyway, since minlength and maxlength are sometimes both necessary for the express purpose of having different error messages.

Attachments

jquery.validate.js.patch Download (502 bytes) - added by Romirez 5 years ago.
patch to remove the code that causes this

Change History

Changed 5 years ago by Romirez

patch to remove the code that causes this

comment:1 Changed 5 years ago by joern

The purpose is to merge min/max/length when specified as seperate attributes:

<input min="5" max="7" />

I'll make that an option in the next release, most likely as "autoCreateRanges". Not sure yet about the default, with this ticket it tends to be false.

comment:2 Changed 5 years ago by joern

  • Owner set to joern

comment:3 Changed 5 years ago by joern

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in [4587]. Set jQuery.validator.autoCreateRanges = true to reenable 1.2 style range conversion.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.