<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" language="JavaScript">
if (![].pop) Array.prototype.pop = ArrayPop;
function ArrayPop()
{
var tempItem = this[this.length-1];
this.length--;
return(tempItem);
}
function moveOption(sourceSelect, targetSelect)
{
var index = new Array()
for (var i = 0; i < sourceSelect.options.length; i++)
{
if (sourceSelect.options[i].selected)
{
index[index.length]=i;
}
}
if (index.length == 0)
{
alert("Please select at least one item to move");
return;
}
while(index.length != 0)
{
var i = index.pop();
var option = sourceSelect.options[i]
var temp = new Option(option.text, option.value)
sourceSelect.options[i] = null
targetSelect.options[targetSelect.options.length] = temp
}
}
function SelectAllOf(){
s=document.AssignPlayer.TeamPlayerList;
for(var i=0;i<s.options.length;i++){
s.options[i].selected=true;
}
t=document.AssignPlayer.AvPlayerList;
for(var i=0;i<t.options.length;i++){
t.options[i].selected=true;
}
}
function ClearThem(){
s=document.AssignPlayer.TeamPlayerList;
for(var i=0;i<s.options.length;i++){
s.options[i] = null;
}
t=document.AssignPlayer.AvPlayerList;
for(var i=0;i<t.options.length;i++){
t.options[i] = null;
}
}
function setStyle(obj,style,value){
getRef(obj).style[style]= value;
}
function getRef(obj){
return (typeof obj == "string") ?
document.getElementById(obj) : obj;
}
</script>
</head>
<body>
Trying to get this worhking on Mozilla/4.0 (compatible; MSIE 5.16; Mac_PowerPC).<br> <br>
It does not work on Does not work on IE 5.2. I am trying to find out what I could change in the JS to make it work?<br> <br>
<form name="AssignPlayer" action="post">
<table width="50" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<input tabindex="5" name="backtolib" type="button" onclick="moveOption(document.AssignPlayer.TeamPlayerList, document.AssignPlayer.AvPlayerList)" value="REMOVE PLAYERS >>" class="button" style="width:270px;"><br>
<select name="TeamPlayerList" class="form_input" size="2" multiple style="width:270px;">
<option value="1">One</option>
</select>
<input tabindex="7" name="backtolib" type="button" onclick="moveOption(document.AssignPlayer.TeamPlayerList, document.AssignPlayer.AvPlayerList)" value="REMOVE PLAYERS >>" class="button" style="width:270px;">
</td>
<td>
<input tabindex="6" name="addtot" type="button" onclick="moveOption(document.AssignPlayer.AvPlayerList, document.AssignPlayer.TeamPlayerList);" value="<< ADD PLAYERS" class="button" style="width:270px;"><br>
<select name="AvPlayerList" class="form_input" size="2" multiple style="width:270px">
<option value="2">Two</option>
</select>
<input tabindex="8" name="addtot" type="button" onclick="moveOption(document.AssignPlayer.AvPlayerList, document.AssignPlayer.TeamPlayerList);" value="<< ADD PLAYERS" class="button" style="width:270px;">
</td>
</tr>
</table>
</form>
</body>
</html>