A form control can unexpectedly take over a property on its containing form. Browsers expose controls through their id or name values, so a control named action or submit can replace the form’s corresponding property and disrupt JavaScript that uses it. section 14.2.3
<form id="form" action="/conceal"> <input type="text" id="action"/> <input type="submit" id="submit"/> </form>
Here, controls named action and submit collide with form properties of the same names. section 14.2.3
When form.submit stops being a method
After a control with id="submit" is added, form.submit can refer to that input rather than the original method. Calling form.submit() can then produce a script error. section 14.2.3
To avoid and diagnose the problem:
- Avoid simple id and name values that conflict with standard form properties; submit is a common pitfall. section 14.2.3
- When a form property seems to have changed unexpectedly, check whether a control has the same id or name. section 14.2.3
