Ver Mensaje Individual
  #2 (permalink)  
Antiguo 10/07/2006, 10:04
TheSaintRules
 
Fecha de Ingreso: junio-2006
Ubicación: Valencia, Venezuela
Mensajes: 22
Antigüedad: 17 años, 10 meses
Puntos: 0
De acuerdo

eso puede ser algo Asi..
el Codigo JavaScript
Código:
<script>

var arrOldValues;
function SelectAllList(CONTROL){
for(var i = 0;i < CONTROL.length;i++){
CONTROL.options[i].selected = true;
}
}
function DeselectAllList(CONTROL){
for(var i = 0;i < CONTROL.length;i++){
CONTROL.options[i].selected = false;
}
}

function FillListValues(CONTROL){
var arrNewValues;
var intNewPos;
var strTemp = GetSelectValues(CONTROL);
arrNewValues = strTemp.split(",");
for(var i=0;i<arrNewValues.length-1;i++){
if(arrNewValues[i]==1){
intNewPos = i;
}
}
for(var i=0;i<arrOldValues.length-1;i++){
if(arrOldValues[i]==1 && i != intNewPos){
CONTROL.options[i].selected= true;
}
else if(arrOldValues[i]==0 && i != intNewPos){
CONTROL.options[i].selected= false;
}
if(arrOldValues[intNewPos]== 1){
CONTROL.options[intNewPos].selected = false;
}
else{
CONTROL.options[intNewPos].selected = true;
}
}
}

function GetSelectValues(CONTROL){
var strTemp = "";
for(var i = 0;i < CONTROL.length;i++){
if(CONTROL.options[i].selected == true){
strTemp += "1,";
}
else{
strTemp += "0,";
}
}
return strTemp;
}
function GetCurrentListValues(CONTROL){
var strValues = "";
strValues = GetSelectValues(CONTROL);
arrOldValues = strValues.split(",")
}
</script>

codigo html
Código HTML:
<form name=theForm id=theForm>
Please select the items you'd like for Christmas
<br>
<br>
<select size=11 name=Christmas_List id=Christmas_List multiple onMouseDown="GetCurrentListValues(this);" onchange="FillListValues(this);" style="width:200;">
<option>Widescreen TV</option>
<option>DVD Recorder</option>
<option>Digital Camcorder</option>
<option>Digital Camera</option>
<option>Satsuma</option>
<option>Hi Fi System</option>
<option>Speakers</option>
<option>Electric Guitar</option>
<option>Portastudio</option>
<option>Sports Car</option>
<option>Tasty Wench</option>
</select>
<br>
<font face=arial size=1><a href="javascript:SelectAllList(document.theForm.Christmas_List);" style="color:blue;">select all</a> &nbsp;&nbsp;<a href="javascript:DeselectAllList(document.theForm.Christmas_List);" style="color:blue;">deselect all</a></font> 

Espero sea lo q buscas Suerte
__________________
TecnoSoluciones de Venezuela C.A.
Andy G Sanchez
Web Developer
+584125314418