Ticket #17074: 17074.diff

File 17074.diff, 815 bytes (added by julien, 3 years ago)
  • django/contrib/admin/templates/admin/change_form.html

    diff --git a/django/contrib/admin/templates/admin/change_form.html b/django/contrib/admin/templates/admin/change_form.html
    index de44298..8149317 100644
    a b  
    6767{% block submit_buttons_bottom %}{% submit_row %}{% endblock %}
    6868
    6969{% if adminform and add %}
    70    <script type="text/javascript">document.getElementById("{{ adminform.first_field.id_for_label }}").focus();</script>
     70   <script type="text/javascript">
     71       (function($) {
     72           $(document).ready(function() {
     73               $('form#{{ opts.module_name }}_form :input:visible:enabled:first').focus()
     74           });
     75       })(django.jQuery);
     76   </script>
    7177{% endif %}
    7278
    7379{# JavaScript for prepopulated fields #}
Back to Top