JavaScript - COMO BORRAR UN OBJETO DE UNA LISTA

 
Vista:

COMO BORRAR UN OBJETO DE UNA LISTA

Publicado por Esmeralda (30 intervenciones) el 13/08/2001 22:03:03
Hola,mi duda es como puedo borrar un objeto de una lista, quiero que al selecionar le de a un boton borrar, pero sin recargar pagina, espero su ayuda , gracias

Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:COMO BORRAR UN OBJETO DE UNA LISTA

Publicado por Jorge M (49 intervenciones) el 14/08/2001 01:17:01
Específicamente que elementos de html estás utilizando?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:COMO BORRAR UN OBJETO DE UNA LISTA

Publicado por Esmeralda (30 intervenciones) el 14/08/2001 01:49:10
MIRA ESTOY USANDO SELECT SIMPLE OSEA UN LIST SIMPLE,NO ES DESPLEGABLE,MIRA CON LA OPCION ONCLICK AGREGA DATOS A ESA LISTA,PERO LO QUE QUIERO ES CUANDO LE DE DOBLE CLICK A UNO DE LOS ELEMENTOS ME LO BORRE, O CON UN CLICK Y UN BOTON DE BORRAR, DE LA MANERA QUE SEA PERO QUE BORRE OJALA ME PUEDAN AYUDAR,GRACIAS.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:COMO BORRAR UN OBJETO DE UNA LISTA

Publicado por Jorge M (49 intervenciones) el 14/08/2001 10:06:59
Saludos.
Parece que ya salió.

<HTML><HEAD><SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
<!--
function borra()
{
for (i=0 ;i<document.Forma.Lista.options.length+1;i++ ) {
if (document.Forma.Lista.options(i).selected==true) {
document.Forma.Lista.options.remove(i);
return false;
}
}
}

// -->
</SCRIPT></HEAD><BODY><FORM name="Forma" onDblClick="borra()">
<SELECT NAME="Lista" SIZE="8" >
<OPTION VALUE="1">1</OPTION>
<OPTION VALUE="2">2</OPTION>
<OPTION VALUE="2">2</OPTION>
<OPTION VALUE="3">3</OPTION>
<OPTION VALUE="4">4</OPTION>
<OPTION VALUE="5">5</OPTION>
<OPTION VALUE="6">6</OPTION>
</SELECT>
</FORM></BODY></HTML>
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar