Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/09/2008, 11:47
daor
 
Fecha de Ingreso: agosto-2008
Mensajes: 7
Antigüedad: 16 años, 7 meses
Puntos: 0
PHP(while) alert field

TENGO UN DROP DOWN MENU QUE HAGO CON UN WHILE :
.................................................. .................................................. .................
$unidades = array('Metros', 'M2', 'Pzas', 'Botes', 'Kilos', 'Equipos', 'Pies');

$SelectUnidades = "<select name=unidades>\n\t<option value=\"\"></option>\n\t";

while(list(,$zz) = each($unidades))
{
$SelectUnidades .= "<option value=\"$zz\">$zz</option>\n\t";
}

$SelectUnidades .= "</select>";
.................................................. .................................................. ................

Y LO PONGO EN UNA FORMA ASI : <?=$SelectUnidades?>

PERO AL CHECAR QUE SE SELECCIONE EL CAMPO EN JAVASCRIPT NO MARCA LA ALERTA :

.................................................. .................................................. ................

if(document.f1.unidades.value=="")
{
window.alert('Ingresa unidades porfavor!');
document.f1.unidades.focus();
return false;
}
.................................................. .................................................. ............


ALGUIEN ME PUEDE GUIAR PARA QUE PUEDA DAR ALERTAS CON ESTE CODIGO WHILE ... GRACIAS