diff --git a/django/contrib/admin/templates/admin/change_form.html b/django/contrib/admin/templates/admin/change_form.html
index 2fb17bb..2b7a120 100644
a
|
b
|
|
55 | 55 | {% submit_row %} |
56 | 56 | |
57 | 57 | {% if add %} |
58 | | <script type="text/javascript">document.getElementById("{{ adminform.first_field.auto_id }}").focus();</script> |
| 58 | <script type="text/javascript"> |
| 59 | (function(){ |
| 60 | var forms = document.forms || []; |
| 61 | for(var i = 0; i < forms.length; i++){ |
| 62 | for(var j = 0; j < forms[i].length; j++){ |
| 63 | if( |
| 64 | forms[i][j].type != "hidden" |
| 65 | && forms[i][j].disabled != true |
| 66 | && forms[i][j].style.display != 'none' |
| 67 | && forms[i][j].nodeName.toLowerCase() != 'fieldset' |
| 68 | ){ |
| 69 | forms[i][j].focus(); |
| 70 | return; |
| 71 | } |
| 72 | } |
| 73 | } |
| 74 | })(); |
| 75 | </script> |
59 | 76 | {% endif %} |
60 | 77 | |
61 | 78 | {# JavaScript for prepopulated fields #} |