Browse files

magic-removal: Fixed #1063 -- Fixed admin JS bug in which many-to-man…

…y selections were lost after using 'Add another'

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2740 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 2d5d40a commit 9b8332f7df6261c50ad5b32e8a49bc307027a285 @adrianholovaty adrianholovaty committed Apr 23, 2006
Showing with 1 addition and 1 deletion.
  1. +1 −1 django/contrib/admin/media/js/admin/RelatedObjectLookups.js
View
2 django/contrib/admin/media/js/admin/RelatedObjectLookups.js
@@ -39,7 +39,7 @@ function dismissAddAnotherPopup(win, newId, newRepr) {
if (elem.nodeName == 'SELECT') {
var o = new Option(newRepr, newId);
elem.options[elem.options.length] = o;
- elem.selectedIndex = elem.length - 1;
+ o.selected = true;
} else if (elem.nodeName == 'INPUT') {
elem.value = newId;
}

0 comments on commit 9b8332f

Please sign in to comment.