| Server IP : 172.67.216.113 / Your IP : 172.71.28.146 [ Web Server : Apache System : Linux cpanel01wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.59.el6.x86_64 #1 SMP Thu Dec 6 05:11:00 EST 2018 x86_64 User : cp648411 ( 1354) PHP Version : 7.2.34 Disable Function : NONE Domains : 0 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/2388322/cwd/3rdparty/phpPgAdmin/ |
Upload File : |
// Globals
//
/*
* Multiple Selection lists in HTML Document
*/
var tableColumnList;
var indexColumnList;
/*
* Two Array vars
*/
var indexColumns, tableColumns;
function buttonPressed(object) {
if (object.name == "add") {
from = tableColumnList;
to = indexColumnList;
}
else {
to = tableColumnList;
from = indexColumnList;
}
var selectedOptions = getSelectedOptions(from);
for (i = 0; i < selectedOptions.length; i++) {
option = new Option(selectedOptions[i].text);
addToArray(to, option);
removeFromArray(from, selectedOptions[i].index);
}
}
function doSelectAll() {
for(var x = 0; x < indexColumnList.options.length; x++){
indexColumnList.options[x].selected = true;
}
}
function init() {
tableColumnList = document.formIndex.TableColumnList;
indexColumnList = document.getElementById("IndexColumnList");
indexColumns = indexColumnList.options;
tableColumns = tableColumnList.options;
}
function getSelectedOptions(obj) {
var selectedOptions = new Array();
for (i = 0; i < obj.options.length; i++) {
if (obj.options[i].selected) {
selectedOptions.push(obj.options[i]);
}
}
return selectedOptions;
}
function removeFromArray(obj, index) {
obj.remove(index);
}
function addToArray(obj, item) {
obj.options[obj.options.length] = item;
}