Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/03/2006, 04:29
xias
 
Fecha de Ingreso: enero-2002
Mensajes: 838
Antigüedad: 22 años, 4 meses
Puntos: 1
problema con un for

hola:

quiero limpiar un campo(perfecto) y un select. Para ello utilizo esta funcion:

function limpiar_form_agregar_hora()
{
document.form_agregar_hora.campo_horario.value="";
for (x=document.form_agregar_hora.select_agregar_hora. length;x>=0;x--)
document.form_agregar_hora.select_agregar_hora[x] = null;
break;
}

pero me da error "no puede haber 'break' fuera de un bucle".
si lo pongo:

for (x=document.form_agregar_hora.select_agregar_hora. length;x>=0;x--)
{
document.form_agregar_hora.select_agregar_hora[x] = null;
break;
}

no me da error pero tampoco me funciona....¿como lo puedo hacer???

gracias, un saludo
__________________
Muchas gracias, saludos.