#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: |
Description
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)
Change History (5)
Changed 15 years ago by
Attachment: | jquery.validate.js.patch added |
---|
comment:1 Changed 15 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
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
Resolution: | invalid |
---|---|
Status: | closed → reopened |
This is a simple and appropriate fix - why was this rejected?
comment:3 Changed 13 years ago by
Simply insert the following line
if (typeof rules === 'string') rules[this] = eval(rules[this]);
comment:4 Changed 13 years ago by
Component: | plugin → unfiled |
---|---|
Resolution: | → invalid |
Status: | reopened → closed |
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.
patch to evaluate string if needed