Foros del Web » Programando para Internet » Javascript »

array dinamico

Estas en el tema de array dinamico en el foro de Javascript en Foros del Web. Me podrian ayudar, aparte del combo, tengo que hacer un array dinamico el cual me permita meter mis datos del combo a la base de ...
  #1 (permalink)  
Antiguo 24/10/2006, 09:26
 
Fecha de Ingreso: octubre-2006
Mensajes: 9
Antigüedad: 17 años, 6 meses
Puntos: 0
array dinamico

Me podrian ayudar, aparte del combo, tengo que hacer un array dinamico el cual me permita meter mis datos del combo a la base de datos. Muchas Gracias..
  #2 (permalink)  
Antiguo 24/10/2006, 10:39
 
Fecha de Ingreso: octubre-2006
Mensajes: 9
Antigüedad: 17 años, 6 meses
Puntos: 0
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<SCRIPT language=javascript type=text/javascript>




function insertaRenglon(indice, estacion, posicion)
{

alert(document.getElementById('tablaEstacion'));
var x=document.getElementById('tablaEstacion').insertR ow(posicion);
var y=x.insertCell(0);
var z=x.insertCell(1);
y.innerHTML=indice;
z.innerHTML=estacion;
}

function determinaPosicion(posicion){
var renglones = document.getElementById('tablaEstacion').rows;
var indiceNuevoRenglon = renglones.length;

for(var i=1; i<renglones.length; i++){
var col = renglones[i].cells;
var indice = parseInt(col[0].innerHTML);
if(indice > posicion){
return i;
}
}

return indiceNuevoRenglon;
}




function agregaEstacion(InputValue)
{

var NomEstacion = document.formita.cmbCveUniexp.value;
var elOptNew = document.createElement('option');
var elSel = document.getElementById('estacion');

if (elSel.length == 1&&elSel.options[0].value=="inicial")
{
elSel.remove(0);
}
if(NomEstacion!="0")
{
elOptNew.text = InputValue +" "+NomEstacion;
elOptNew.value = InputValue +" "+NomEstacion;
try {
elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
}
catch(ex) {
elSel.add(elOptNew); // IE only
}
}
else
alert("Selecciona una Estacion");
}

function eliminaEstacion()
{
var elSel = document.getElementById('estacion');
var i;
for (i = elSel.length - 1; i>=0; i--) {
if (elSel.options[i].selected) {
elSel.remove(i);
}
}

}

</SCRIPT>

<META content="MSHTML 6.00.2900.2912" name=GENERATOR></HEAD>
<BODY>


<TABLE id=tablaEstacion cellPadding=1 border=1 cellsapcing="1"
name="tablaEstacion">
<TBODY>
<TR>
<TH>Posición</TH>
<TH>Nombre estación</TH></TR></TBODY></TABLE><BR>

<FORM id="formita" name="formita">
<TABLE cellPadding=1 border=1 cellsapcing="1">
<TBODY>
<TR>
<TD>
<SELECT ID="estacion" MULTIPLE="multiple" NAME="estacion">
<OPTION value="inicial">Agrege aqui sus estaciones...</OPTION>

</SELECT>
</TD>
</TR>
<TR>
<TD>Posición:</TD>
<TD><INPUT maxLength=5 name=nombreFlujo id=nombreFlujo></TD>
<TD>Nombre estación:</TD>
<TD>
<SELECT name=cmbCveUniexp>
<OPTION selected value="0">--Seleccione Estacion--</OPTION>
<OPTION value="Estacion Economia">Estacion Economia</OPTION>
<OPTION value="Estacion Recursos Humanos">Estacion Recursos Humanos</OPTION></SELECT>
</TD></TR>
<TR>
<TD><INPUT onclick=javascript:agregaEstacion(nombreFlujo.valu e); type=button value="Agregar Estación"></TD>
<TD><INPUT onclick=javascript:eliminaEstacion(); type=button value="Eliminar Estación"></TD>

<TD align=middle colSpan=2>
<INPUT type=button value="Grabar Flujo">
</TD>
</TR>
</TBODY>
</TABLE>

</FORM>

</BODY></HTML>
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 13:36.