Opened 15 years ago

Closed 15 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:


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.


Change History (4)

comment:1 Changed 15 years ago by guest

Appears to be a dupe of #2347 but I provide more info. :)

comment:2 Changed 15 years ago by Adam Peller

Owner: changed from dylan to dante

comment:3 Changed 15 years ago by Adam Peller

Component: ValidateDojox

comment:4 Changed 15 years ago by dante

Resolution: wontfix
Status: newclosed

seems like this says you can't name="#" any input element anyway.

Note: See TracTickets for help on using tickets.