Hello everyone!

I currently have code that will generate a random input into a text box within the same window upon a button click. Is there a way I can make this code populate a text box on a parent window if the code is contained within a popup? The program I'm using is encrypted with only limited access to template files or else I'd just include the code on the page itself.

Here is my current code:
$(function() {
    $('#genID').click(function() {
        var SystemID = "";
        var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

        for (var i = 0; i < 8; i++)
        SystemID += possible.charAt(Math.floor(Math.random() * possible.length));