Skip to main content

Bug Tracker

Side navigation

#10909 closed bug (duplicate)

Opened November 28, 2011 05:17PM UTC

Closed November 28, 2011 07:29PM UTC

Last modified November 28, 2011 07:30PM UTC

.submit() fails when field named "submit" exists

Reported by: tiago.carvalho@gmail.com 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>
Attachments (0)
Change History (4)

Changed November 28, 2011 05:34PM UTC by tiago.carvalho@gmail.com comment:1

Found a problem while using a form field named "submit"

test case: http://jsfiddle.net/mWn4D/1/

Changed November 28, 2011 05:58PM UTC by mofle comment:2

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.

Changed November 28, 2011 07:29PM UTC by dmethvin comment:3

resolution: → duplicate
status: newclosed

Changed November 28, 2011 07:30PM UTC by dmethvin comment:4

Duplicate of #1414.