unexpected attr behavior on form with input element named 'action'
|Reported by:||rryan||Owned by:||flesler|
Given the following form:
<form action="someaction"> <input type="hidden" name="action" value="somevalue"/> </form>
If you have the dom element for the form, 'f'.
f.action = "foo", sets the value of the input element, not the action attribute on the form.
f.setAttribute("action","foo") sets the action attribute on the form tag.
In jQuery, if you say $("#form").attr("action","foo"), it actually sets the input element named action to 'foo', instead of setting the attribute on the form tag. Is this a bug? 'attr' would seem to imply the functionality of 'setAttribute', not this magic 'action' accessor on the dom element.
Thanks for all your hard work!
Change History (13)
comment:1 Changed 9 years ago by flesler
- need changed from Review to Patch
- Owner set to flesler
- Status changed from new to assigned
comment:12 Changed 6 years ago by rwaldron
- Priority changed from minor to low
- Resolution set to duplicate
- Status changed from assigned to closed