Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/10/2004, 20:11
guntin_java
 
Fecha de Ingreso: mayo-2004
Mensajes: 159
Antigüedad: 20 años, 9 meses
Puntos: 0
funciona con IE y no con Mozila

Hola...

el siguiente código funciona con IE y no con Mozila, me pueden ayudar????

[codigo]
function comprobar(){

var j=2;
var a = new Array();



a[0] = false;
if( document.form.all['habi[0]'].selectedIndex!=0 ||
document.form.all['meal[0]'].selectedIndex!=0 ||
document.form.all['ocup[0]'].selectedIndex!=0 ||
document.form.all['coun[0]'].selectedIndex!=0){


if(document.form.all['habi[0]'].selectedIndex==0){
alert('You should fill the field Room Type');
document.form.all['habi[0]'].focus();
return false;
}

if(document.form.all['meal[0]'].selectedIndex==0){
alert('You should fill the field Meal Plan');
document.form.all['meal[0]'].focus();
return false;
}

if(document.form.all['ocup[0]'].selectedIndex==0){
alert('You should fill the field Occupation');
document.form.all['ocup[0]'].focus();
return false;
}

if(document.form.all['coun[0]'].selectedIndex==0){
alert('You should fill the field Nights');
document.form.all['coun[0]'].focus();
return false;
}
a[0] = true;
}

a[1] = false;
if( document.form.all['habi[1]'].selectedIndex!=0 ||
document.form.all['meal[1]'].selectedIndex!=0 ||
document.form.all['ocup[1]'].selectedIndex!=0 ||
document.form.all['coun[1]'].selectedIndex!=0){


if(document.form.all['habi[1]'].selectedIndex==0){
alert('You should fill the field Room Type');
document.form.all['habi[1]'].focus();
return false;
}

if(document.form.all['meal[1]'].selectedIndex==0){
alert('You should fill the field Meal Plan');
document.form.all['meal[1]'].focus();
return false;
}

if(document.form.all['ocup[1]'].selectedIndex==0){
alert('You should fill the field Occupation');
document.form.all['ocup[1]'].focus();
return false;
}

if(document.form.all['coun[1]'].selectedIndex==0){
alert('You should fill the field Nights');
document.form.all['coun[1]'].focus();
return false;
}
a[1] = true;
}

for(var k=0; k<j; k++){
if (a[k]==true){
document.form.submit();
return true;
}
}
}
[/codigo]