Modify ↓
Ticket #10909 (closed bug: duplicate)
.submit() fails when field named "submit" exists
| Reported by: | tiago.carvalho@… | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | None |
| Component: | unfiled | Version: | 1.7.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
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
comment:2 Changed 19 months ago by mofle
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.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
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/