Opened 5 years ago
Closed 5 years ago
#31361 closed Cleanup/optimization (fixed)
Fix admin invalid HTML5 empty action="" attribute.
Reported by: | Jon Dufresne | Owned by: | Jon Dufresne |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The attribute action=""
(empty string) on the <form>
element is invalid HTML5. The spec says:
The action and formaction content attributes, if specified, must have a value that is a valid non-empty URL potentially surrounded by spaces.
Emphasis on non-empty. The action attribute is allowed to be omitted, in which case the current URL is used which is the same behavior as now.
The nu validator reports the message:
Error: Bad value for attribute action on element form: Must be non-empty.
In the admin, this can occur in two templates:
https://github.com/django/django/blob/3.0.4/django/contrib/admin/templates/admin/auth/user/change_password.html#L22
https://github.com/django/django/blob/3.0.4/django/contrib/admin/templates/admin/change_form.html#L36
Change History (4)
comment:1 by , 5 years ago
Has patch: | set |
---|
comment:2 by , 5 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Summary: | Fix admin invalid HTML5 empty action="" attribute → Fix admin invalid HTML5 empty action="" attribute. |
Triage Stage: | Unreviewed → Accepted |
Thanks.
Note: A form example in MDN Web docs still contains action=""
.
comment:3 by , 5 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
https://github.com/django/django/pull/12564