Ver Mensaje Individual
  #9 (permalink)  
Antiguo 21/10/2008, 19:02
jhelu
 
Fecha de Ingreso: enero-2002
Mensajes: 106
Antigüedad: 22 años, 3 meses
Puntos: 0
Respuesta: Ayuda con un if en php

Si, si lo tengo, te lo muestro a continuación, saludos y gracias...



<script>
<!--
secciones = new Array(

// AQUI ESTA EL EJEMPLO, SE IMPRIME UNAS CATEGORIAS, SU NOMBRE Y SU ID DENTRO DE UN ARREGLO ANIDADO SEGUN LO QUE HICE.
// LEE MAS ABAJO PARA QUE CHEQUES DONDE NO DEBE DE IR YA LA COMA IMPRESA


new Array(

new Array("Locales", 1)
,
new Array("Nacionales", 2)
,
new Array("Internacionales", 3)
,
new Array("Policiacas", 4)
),

new Array(

new Array("Futbol", 9)
,
new Array("Beisbol", 10)
,
new Array("Mundial 2002", 11)
),

new Array(

new Array("Local", 12)
,
new Array("Nacional", 13)
,
new Array("Internacional", 14)
),

new Array(

new Array("Espectaculos", 15)
,
new Array("Sociales", 16)

// SI TE FIJAS AQUI YA NO APARECE LA COMA
),

null);

function fillSelectFromArray(selectCtrl, itemArray, goodPrompt, badPrompt, defaultItem) {
var i, j;
var prompt;
// empty existing items
for (i = selectCtrl.options.length; i >= 0; i--) {
selectCtrl.options[i] = null;
}
prompt = (itemArray != null) ? goodPrompt : badPrompt;
if (prompt == null) {
j = 0;
}
else {
selectCtrl.options[0] = new Option(prompt);
j = 1;
}
if (itemArray != null) {
// add new items
for (i = 0; i < itemArray.length; i++) {
selectCtrl.options[j] = new Option(itemArray[i][0]);
if (itemArray[i][1] != null) {
selectCtrl.options[j].value = itemArray[i][1];
}
j++;
}
// select first item (prompt) for sub list
selectCtrl.options[0].selected = true;
}
}
//-->
</script>
__________________
Jherrera.NET