#10909 closed bug (duplicate)
.submit() fails when field named "submit" exists
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Found a problem while using a form field named "submit"
<iframe name="goto"></iframe> <form id="myform"> <input type="text" name="submit" value="1" /> </form> <script> $(function() { $("#myform").submit(); /* this FAILS */ }); </script>
Change History (4)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
This is not a bug. See the docs: http://api.jquery.com/submit/
Forms and their child elements should not use input names or ids that conflict with properties of a form, such as submit, length, or method. Name conflicts can cause confusing failures. For a complete list of rules and to check your markup for these problems, see DOMLint.
comment:3 Changed 11 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
Found a problem while using a form field named "submit"
test case: http://jsfiddle.net/mWn4D/1/