Skip to content

Instantly share code, notes, and snippets.

@ustun
Created April 1, 2014 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ustun/9921552 to your computer and use it in GitHub Desktop.
Save ustun/9921552 to your computer and use it in GitHub Desktop.
function sendIdToPopupOpener(win, chosenId) {
var name = windowname_to_id(win.name);
var elem = window.opener.document.getElementById(name);
if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) {
elem.value += ',' + chosenId;
} else {
window.opener.document.getElementById(name).value = chosenId;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment