Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#14858 closed (duplicate)

Bug in admin change_form template produces javascript error when adding new object with first_field of type DateTimeField.

Reported by: mkelley33 Owned by: nobody
Component: contrib.admin Version: 1.2
Severity: Keywords: admin templates javascript error
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by ramiro)


  1. User fires up admin site in browser (bug is not browser specific), and goes to admin/app_name/model_name/
  2. User clicks the add button in upper-right-hand corner.
  3. The change_form.html template is rendered, and ready to add a new object.
  4. Then the user's browser complains and throws an error, because the user (for whatever--probably strange and arguably wrong--reason) made created_datetime of type DateTimeField be the first_field.

Error or Bug:

Error: document.getElementById("id_created_date") is null
Source File:


The DateTimeField outputs two fields:

  1. created_date_0
  2. created_date_1


See attached patch file.

Attachments (1)

change_form_r14851_js_bug_fix.diff (1.1 KB) - added by mkelley33 <michauxkelley@…> 5 years ago.
Patch for JavaScript bug in change_form.html on admin site.

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by mkelley33 <michauxkelley@…>

Patch for JavaScript bug in change_form.html on admin site.

comment:1 Changed 5 years ago by ramiro

  • Description modified (diff)
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

This had already been reported as #14364. Will try to reproduce with the more detailed instructions above before deciding final triage status.

comment:2 Changed 5 years ago by ramiro

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #10573.

comment:3 Changed 4 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top