Bug Tracker

Opened 15 years ago

Closed 13 years ago

Last modified 11 years ago

#2660 closed bug (invalid)

[validate] range values are read incorrectly from markup

Reported by: etal Owned by:
Priority: major Milestone: 1.2.4
Component: unfiled Version: 1.2.1
Keywords: validate Cc:
Blocked by: Blocking:


When assigning ranges (and rangelength) through markup ,for example:

<input id="days" name="days" class="range required" type="text" range="[1,99]" />

the range is interpreted as a string and not an array leading to incorrect validation and inability to submit form.

Attachments (1)

jquery.validate.js.patch (482 bytes) - added by etal 15 years ago.
patch to evaluate string if needed

Download all attachments as: .zip

Change History (5)

Changed 15 years ago by etal

Attachment: jquery.validate.js.patch added

patch to evaluate string if needed

comment:1 Changed 15 years ago by scott.gonzal

Resolution: invalid
Status: newclosed

Setting up validation via attributes is only supported for validation methods that expect strings or numbers as their parameters.

To setup range validation set min and max via attributes and use the autoCreateRanges option.

comment:2 Changed 13 years ago by sadgit

Resolution: invalid
Status: closedreopened

This is a simple and appropriate fix - why was this rejected?

comment:3 Changed 13 years ago by sadgit

Simply insert the following line

if (typeof rules === 'string') rules[this] = eval(rules[this]);

comment:4 Changed 13 years ago by dmethvin

Component: pluginunfiled
Resolution: invalid
Status: reopenedclosed

This is not a jQuery core bug. Please use the plugin's support channel (such as the forums or the plugins page) to request features or report bugs.

Note: See TracTickets for help on using tickets.