Foros del Web » Programando para Internet » Javascript »

Internet explorer 6

Estas en el tema de Internet explorer 6 en el foro de Javascript en Foros del Web. <P>Sistema Operativo: <SELECT NAME="SO" id="SO"> <OPTION>Windows XP</OPTION> <OPTION>Windows Vista</OPTION> <OPTION>Windows 98</OPTION> <OPTION>Windows 95</OPTION> <OPTION>Windows NT</OPTION> <OPTION>Windows 2000</OPTION> <OPTION>Linux</OPTION> <OPTION>Mac OS</OPTION> </SELECT></P> <input type="button" VALUE="ADMIN" onclick=" ...
  #1 (permalink)  
Antiguo 08/06/2008, 10:01
 
Fecha de Ingreso: junio-2008
Mensajes: 8
Antigüedad: 15 años, 10 meses
Puntos: 0
Internet explorer 6

<P>Sistema Operativo: <SELECT NAME="SO" id="SO">
<OPTION>Windows XP</OPTION>
<OPTION>Windows Vista</OPTION>
<OPTION>Windows 98</OPTION>
<OPTION>Windows 95</OPTION>
<OPTION>Windows NT</OPTION>
<OPTION>Windows 2000</OPTION>
<OPTION>Linux</OPTION>
<OPTION>Mac OS</OPTION>
</SELECT></P>


<input type="button" VALUE="ADMIN" onclick="
document.getElementById('admin').value='Tiene ' + document.getElementById('SO').value">

Porque en firefox me funciona perfectamente, en internet explorer 7 también pero en el 6 no, que es el que tengo en el trabajo y como podría solucionarlo? un saludo
  #2 (permalink)  
Antiguo 08/06/2008, 10:46
Avatar de Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 20 años
Puntos: 834
Respuesta: Internet explorer 6

Agregá un atributo value a cada option y funcionará correctamente:
Código PHP:
<p>Sistema Operativo: <select name="SO" id="SO">
<
option value="Windows XP">Windows XP</option>
</
select ></p
Y ojo con tu sintaxis html: los tags van en miníscula.
  #3 (permalink)  
Antiguo 08/06/2008, 11:56
Avatar de tunait
Moderadora
 
Fecha de Ingreso: agosto-2001
Ubicación: Terok Nor
Mensajes: 16.805
Antigüedad: 22 años, 8 meses
Puntos: 381
Respuesta: Internet explorer 6

Buenaas (hola Panino )

Otra opción para no tener que agregar los value a los option sería pedírselo así

Código:
<input type="button" VALUE="ADMIN" onclick="
document.getElementById('admin').value='Tiene ' + document.getElementById('SO')[document.getElementById('SO').selectedIndex].text">
Un saludo
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 03:28.