Opened 14 years ago
Closed 13 years ago
#2736 closed defect (wontfix)
fields named by integers bug in dojo.validate.check
Reported by: | guest | Owned by: | dante |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Dojox | Version: | 0.4.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
I have been beating my head against a wall for a bit trying to run dojo.validate.check. Turns out that I think I found a bug.
I run a CMS that names form fields by id number (I know, it's doofy, but it works). So I get something like this for the username field:
<input id="32" name="32" value=""> etc
I created a validation profile to validate this as a required field:
required: ["32", "34", "35"],
But when validate.check runs it gets to this section:
var elem = form[profile.required[i]];
form32? causes this to get the 32nd item in the form array, not the element names "32". I changed it to this:
var elem = form.elements.namedItem(profile.required[i]);
And it works to run validation against fields named as a number.
I checked and this is still in dojo-0.4.2.
Josh
Change History (4)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
Owner: | changed from dylan to dante |
---|
comment:3 Changed 14 years ago by
Component: | Validate → Dojox |
---|
comment:4 Changed 13 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
seems like this says you can't name="#" any input element anyway.
Appears to be a dupe of #2347 but I provide more info. :)