$(document).on() not working with name="disabled"
|Reported by:||stevene||Owned by:||gibson042|
If a form includes an element with a name attribute of 'disabled', the .on function does not prevent the form from being submitted (when used with a descendant selector).
This form is not prevented from submitting:
<form action="google.com"> <input type="text" name="disabled" value="Some text" /> <input type="submit" /> </form>
$(document).on('submit', 'form', false);
If the name of the text input was changed to anything other than 'disabled' the form is prevented from submitting.
Strangely, if I change the method to the following, the original form would not submit (even with the name="disabled" attribute)
Example: Two identical forms, one with name="disabled" http://jsfiddle.net/y3HVA/
Note: I am not trying to disable this field, I simply wanted to use the name 'disabled' as the attribute.
Change History (5)
comment:3 Changed 4 years ago by dmethvin
- Owner set to gibson042
- Status changed from new to assigned
comment:4 Changed 4 years ago by Richard Gibson
- Resolution set to fixed
- Status changed from assigned to closed