Ver Mensaje Individual
  #4 (permalink)  
Antiguo 14/01/2011, 22:46
fa2012
 
Fecha de Ingreso: enero-2011
Mensajes: 159
Antigüedad: 13 años, 3 meses
Puntos: 1
Respuesta: Combinacion php con javascript formulario incompatible con IE, pero compat

esta es la parte javascript que corresponde a los campos que cambian dinamicamente

<? ?>

<script type="text/javascript">

/************************************************

Listas dependientes por Tunait!(5/1/04)

Si quieres usar este script en tu sitio

eres libre de hacerlo con la condición

de que permanezcan intactas estas líneas,

osea, los créditos.

No autorizo a publicar y ofrecer el código

en sitios de script sin previa autorización

Si quieres publicarlo, por favor, contacta conmigo.

http://javascript.tunait.com/

[email protected]


*************************************************/

function slctr(valor){
this.texto = valor
this.valor = valor
}

var Europe=new Array()
Europe[0] = new slctr('Select!!!!')
Europe[1] = new slctr('Europegeneral')
Europe[2] = new slctr('Spain')

var SouthAmerica=new Array()
SouthAmerica[0] = new slctr('Select!!!!')
SouthAmerica[1] = new slctr('Ciudades')

var NorthCenterAmerica=new Array()
NorthCenterAmerica[0] = new slctr('Select!!!!')
NorthCenterAmerica[1] = new slctr('Cities')

var Asia=new Array()
Asia[0] = new slctr('Select!!!!')
Asia[1] = new slctr('Asiageneral')

var Africa=new Array()

Africa[0] = new slctr('Select!!!!')
Africa[1] = new slctr('Africageneral')



//nietos

var Europegeneral = new Array()
<? require("./europa.html"); ?>

var Asiageneral = new Array()
<? require("./asia.html"); ?>

var Cities = new Array()
<? require("./ncamerica.html"); ?>

var Africageneral = new Array()
<? require("./africa.html"); ?>

var Ciudades = new Array()

<? require("./samerica.html"); ?>

var Spain = new Array()
<? require("./spain.html"); ?>








function slctryole(cual,donde){

if(cual.selectedIndex != 0){

donde.length=0

cual = eval(cual.value)

for(m=0;m<cual.length;m++){

var nuevaOpcion = new Option(cual[m].texto);

donde.options[m] = nuevaOpcion;

if(cual[m].valor != null){

donde.options[m].value = cual[m].valor

}

else{

donde.options[m].value = cual[m].texto

}

}

}

}

</script>









<form name="form1" method="post" action="">

<select name="country1" onchange="slctryole(this,this.form.provincia1)">

<option SELECTED>Select your city</option>

<option value="Europe">Europe</option>

<option value="Asia">Asia</option>

<option value="SouthAmerica">South America</option>

<option value="NorthCenterAmerica">North-Center America</option>

<option value="Africa">Africa</option>

</select>

&nbsp;&nbsp;&nbsp;&nbsp;<select name="provincia1" onchange="slctryole(this,this.form.city1)">

<option>- - - - - - - - - - - - -</option>

</select>

&nbsp;&nbsp;&nbsp;&nbsp;
<select name="city1">

<option>- - - - - - - - - - - - - - - </option>

</select>

</form>