Ticket #18420: django_admin_first_field_focus.2.diff
File django_admin_first_field_focus.2.diff, 747 bytes (added by , 12 years ago) |
---|
-
django/contrib/admin/templates/admin/change_form.html
65 66 66 67 {% block submit_buttons_bottom %}{% submit_row %}{% endblock %} 67 68 68 {% if adminform and add %}69 <script type="text/javascript">document.getElementById("{{ adminform.first_field.id_for_label }}").focus();</script>69 {% if adminform.first_field and add %} 70 <script type="text/javascript">document.getElementById("{{ adminform.first_field.id_for_label }}").focus();</script> 70 71 {% endif %} 71 72 72 73 {# JavaScript for prepopulated fields #}