Skip to content

Instantly share code, notes, and snippets.

Created February 8, 2012 23:01
Show Gist options
  • Save anonymous/1775221 to your computer and use it in GitHub Desktop.
Save anonymous/1775221 to your computer and use it in GitHub Desktop.
TheWarden - pastebin.com/3bv12LsW
function selectStoreValues(fromElementID,toElementID)
{
var fileToTableObj = document.getElementById('ImportexportFilesSelected');
var fileToTable = fileToTableObj.options[fileToTableObj.selectedIndex].value;
var txtSelectedValuesObj = document.getElementById(toElementID);
var selectedArray = new Array();
var selObj = document.getElementById(fromElementID);
var i;
var count = 0;
for (i=0; i<selObj.options.length; i++)
{
if (selObj.options[i].selected)
{
selectedArray[count] = selObj.options[i].value;
count++;
}
}
//txtSelectedValuesObj.value = selectedArray;
var mikhail = Object.create(null);
//Object.defineProperty(mikhail, fileToTable, { value: 'here', writable: true, configurable: true, enumerable: true });
mikhail['name'] = 'mikhail';
mikhail['age'] = 19;
mikhail['gender'] = 'male';
mikhail['table'] = fileToTable;
mikhail[fileToTable] = selectedArray;
alert(mikhail['dma.zip:stb_dma']);
alert(mikhail['programs.zip:stb_programs']);
//txtSelectedValuesObj.value = mikhail;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment