Ver Mensaje Individual
  #23 (permalink)  
Antiguo 12/09/2005, 08:48
Avatar de Cap.Buscapina
Cap.Buscapina
 
Fecha de Ingreso: octubre-2004
Ubicación: Argentina
Mensajes: 836
Antigüedad: 19 años, 7 meses
Puntos: 4
hola a todos,

sin animo de enredar mas las cosas te dejo un script que saque de javascript.com y al cual le agregué unas cuantas cosas mas, y que creo que se puede adaptar a lo que queres.(y sin necesidad de utilizar un pop up, ya que si se tiene un bloqueador se complican las cosas).

<html>
<HEAD>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT LANGUAGE="JavaScript">
cat=new Array();
cat[0]=new Array();
cat[0][0]="honda";
cat[0][1]="chevrolet";
cat[0][2]="renault";
cat[0][3]="ford";
cat[0][4]="vw";
cat[0][5]="bmw";
cat[0][6]="qqqqhonda";
cat[0][7]="cqqqqqhevrolet";
cat[0][8]="qqqqqqqrenault";
cat[0][9]="qqqqqford";
cat[0][10]="qqqqqqvw";
cat[0][11]="qqqqqqqqbmw";
cat[0][12]="wwwwwwwrenault";
cat[0][13]="wwwwwwford";
cat[0][14]="wwwwwwvw";
cat[0][15]="wwwwwwwbmw";
cat[1]=new Array();
cat[1][0]="mercedez";
cat[1][1]="volvo";
cat[1][2]="scania";
cat[2]=new Array();
cat[2][0]="kawasaki";
cat[2][1]="honda-m";

function verificar()
{
if (document.forms['myForm']['cantidad'].value <1)
{ alert("No hay campos seleccionados para el informe"); return; }

if (document.forms['myForm']['ordenar0'].value == "x")
{ alert("No ha espesificado ningun orden");document.forms['myForm']['ordenar0'].focus(); return; }

if (document.forms['myForm']['cantidad'].value > 1 && document.forms['myForm']['cantidad'].value<4)
{ confirmar=confirm("Solo ha seleccionado menos de 4 campos. Desea continuar");
if (confirmar){
document.forms['myForm'].submit();
}
}else{

document.forms['myForm'].submit();
}
}
function res(){
for (rr=4; rr>0;rr--){
document.getElementById(rr).style.visibility="hidd en";
document.getElementById((rr*10)).value="x";
document.getElementById('esconder').style.visibili ty="hidden";
}
}
function llenar(para,desde){
if (desde==null){
var xx=1;
for (p=0; p<cat.length;p++){
for (o=0; o<cat[p].length;o++){
para.options[xx]=new Option(document.myForm.seleccionar.options[p+1].value+"."+cat[p][o],document.myForm.seleccionar.options[p+1].value+"."+cat[p][o],false,false);
xx++
}
}
}else{
document.getElementById('esconder').style.visibili ty="visible";
hasta=desde.options.length;
qw=1;
qe=1
while (qw<hasta){
if (desde.options[qw].value==desde.value){
hasta-1;
qw++
}else{
para.options[qe]=new Option(desde.options[qw].value,desde.options[qw].value,false,false);
qw++;
qe++
}
}
}
}
function borrar(){
var caja = document.myForm.listRight.options;
if (caja.selectedIndex==-1){
alert("Debe elegir al menos un items");
}else{
for (q=caja.length-1; q>-1; q--){
if (caja[q].selected==true){
if (q==caja.length-1){
caja[q]=null;
}else{
for (r=q+1; r<caja.length;r++){
caja[r-1].value=caja[r].value;
caja[r-1].text=caja[r].text;
caja[r-1].selected=false;
}
caja[caja.length-1]=null;
}
}
}
}
document.myForm.cantidad.value=document.myForm.lis tRight.options.length;
document.myForm.cantidad2.value=document.myForm.li stLeft.options.length+" de "+cat[document.myForm.seleccionar.selectedIndex-1].length;
}

function cambiar(valor,depurar){
var opcr = document.myForm.listRight.options;
var opc = document.myForm.listLeft.options;
var opco = document.myForm.omitidos.options;
var sel = document.myForm.seleccionar.value;
var coincidencia=0;
var depurado=0;
var encontro="no"
if (opcr.length<1){
opcrll=1;
com2=0
}else{
opcrll=opcr.length;
}
cuenta=cat[valor-1].length;
if (valor>0){
valor=valor-1;
for (i=0; i<cuenta;i++){
for (z=0;z+1<opcrll+1;z++){
com1=sel+"."+cat[valor][i];
if (opcr.length<1){
com2=0;
}else{
com2=opcr[z].value;
}
if (com1==com2 && document.myForm.filtrar.checked){
opco[coincidencia]=new Option(com1,com1,false,false);
coincidencia++;
encontro="si";
}
}
if (encontro=="no"){
opc[depurado]=new Option(com1,com1,false,false);
depurado++;
}else
encontro="no";

}

if (depurado<depurar){
for (x = depurar; x > depurado-1; x--){
opc[x]=null;
}
}
if (opco.length>coincidencia-1){
for (y = opco.length; y > coincidencia-1; y--){
opco[y]=null;
}

}
}
document.myForm.veromitidos.value=coincidencia+" items Omitidos";

if (coincidencia>0){
document.getElementById('combo').style.visibility= "visible";
}else{
document.getElementById('combo').style.visibility= "hidden";
document.getElementById('omitidos').style.visibili ty="hidden";
document.getElementById('botones').style.visibilit y="hidden";
}
document.myForm.cantidad.value=document.myForm.lis tRight.options.length;
document.myForm.cantidad2.value=document.myForm.li stLeft.options.length+" de "+cat[document.myForm.seleccionar.selectedIndex-1].length;
}
function orden(pres,fut){
opt=document.myForm.listRight.options;
tope=opt.length;
if (fut>-1 && fut<tope){
proVal=opt[fut].value;
proTex=opt[fut].text;
opt[fut].value=opt[pres].value;
opt[fut].text=opt[pres].text;
opt[pres].value=proVal;
opt[pres].text=proTex;
opt[fut].selected=true;
opt[pres].selected=false;
}
}
function moveDualList( srcList, destList, moveAll )

{
if ( ( srcList.selectedIndex == -1 ) && ( moveAll == false ) )

{

return;

}



newDestList = new Array( destList.options.length );



var len = 0;



for( len = 0; len < destList.options.length; len++ )

{

if ( destList.options[ len ] != null )

{

newDestList[ len ] = new Option( destList.options[ len ].text, destList.options[ len ].value, destList.options[ len ].defaultSelected, destList.options[ len ].selected );

}

}



for( var i = 0; i < srcList.options.length; i++ )

{

if ( srcList.options[i] != null && ( srcList.options[i].selected == true || moveAll ) )

{
newDestList[ len ] = new Option( srcList.options[i].text, srcList.options[i].value, srcList.options[i].defaultSelected, srcList.options[i].selected );
len++;

}

}
for ( var j = 0; j < newDestList.length; j++ )

{

if ( newDestList[ j ] != null )

{

destList.options[ j ] = newDestList[ j ];

}

}
for( var i = srcList.options.length - 1; i >= 0; i-- )

{

if ( srcList.options[i] != null && ( srcList.options[i].selected == true || moveAll ) )

{
srcList.options[i] = null;

}

}


document.myForm.cantidad.value=document.myForm.lis tRight.options.length;
document.myForm.cantidad2.value=document.myForm.li stLeft.options.length+" de "+cat[document.myForm.seleccionar.selectedIndex-1].length;
}
function ver(cual){
if (cual=="criterios"){
for (divx=1; divx<5; divx++){
capa=document.getElementById(divx).style.visibilit y;
selex=document.getElementById((divx*10)).value;
if (selex=="x"){
alert("El "+divx+"° criterio de orden está vacio");
divx=100;
}else{
if (capa=="hidden"){
document.getElementById(divx).style.visibility="vi sible";
divx=100;
}
}
}
}else{
document.getElementById('omitidos').style.visibili ty="visible";
document.getElementById('botones').style.visibilit y="visible";
}
}
</script>
</HEAD>


sigue mas abajo...
__________________
by Capitán Buscapina
.