Foros del Web » Programando para Internet » Javascript »

duda para Obtener valores

Estas en el tema de duda para Obtener valores en el foro de Javascript en Foros del Web. HOla a todos, tengo una consulta que no se como resolver: Código HTML: <html> <head> <!-- Copiar dentro del tag HEAD --> <script LANGUAGE= "JavaScript" ...
  #1 (permalink)  
Antiguo 29/10/2006, 18:03
Avatar de roswell  
Fecha de Ingreso: abril-2004
Ubicación: Buenos Aires
Mensajes: 80
Antigüedad: 20 años
Puntos: 0
Exclamación duda para Obtener valores

HOla a todos, tengo una consulta que no se como resolver:

Código HTML:
<html>
<head>
<!-- Copiar dentro del tag HEAD -->
<script LANGUAGE="JavaScript">

<!--
sortitems = 1; 

function move(fbox,tbox) {
for(var i=0; i<fbox.options.length; i++) {
if(fbox.options[i].selected && fbox.options[i].value != "") {
var no = new Option();
no.value = fbox.options[i].value;
no.text = fbox.options[i].text;
tbox.options[tbox.options.length] = no;
fbox.options[i].value = "";
fbox.options[i].text = "";
   }
}
BumpUp(fbox);
if (sortitems) SortD(tbox);
}
function BumpUp(box)  {
for(var i=0; i<box.options.length; i++) {
if(box.options[i].value == "")  {
for(var j=i; j<box.options.length-1; j++)  {
box.options[j].value = box.options[j+1].value;
box.options[j].text = box.options[j+1].text;
}
var ln = i;
break;
   }
}
if(ln < box.options.length)  {
box.options.length -= 1;
BumpUp(box);
   }
}

function SortD(box)  {
var temp_opts = new Array();
var temp = new Object();
for(var i=0; i<box.options.length; i++)  {
temp_opts[i] = box.options[i];
}
for(var x=0; x<temp_opts.length-1; x++)  {
for(var y=(x+1); y<temp_opts.length; y++)  {
if(temp_opts[x].text > temp_opts[y].text)  {
temp = temp_opts[x].text;
temp_opts[x].text = temp_opts[y].text;
temp_opts[y].text = temp;
temp = temp_opts[x].value;
temp_opts[x].value = temp_opts[y].value;
temp_opts[y].value = temp;
      }
   }
}
for(var i=0; i<box.options.length; i++)  {
box.options[i].value = temp_opts[i].value;
box.options[i].text = temp_opts[i].text;
   }
}
// -->
</script>
</head>

<body>
<!-- Copiar dentro del tag BODY -->

<form ACTION METHOD="POST">
  <table border="0">
    <tr>
      <td><select multiple size="5" name="list1">
        <option value="11"> item 1.1 </option>
        <option value="12"> item 1.2 </option>
        <option value="13"> item 1.3 </option>
      </select></td>
      <td><input type="button" value="   &gt;&gt;   "
      onclick="move(this.form.list1,this.form.list2)" name="B1"><br>
      <input type="button" value="   &lt;&lt;   "
      onclick="move(this.form.list2,this.form.list1)" name="B2"> </td>
      <td><select multiple size="5" name="list2">
      </select></td>
    </tr>
  </table>


  <table border="0">
    <tr>
      <td><select multiple size="5" name="list3">
        <option value="11"> item 1.1 </option>
        <option value="12"> item 1.2 </option>
        <option value="13"> item 1.3 </option>
      </select></td>
      <td><input type="button" value="   &gt;&gt;   "
      onclick="move(this.form.list3,this.form.list4)" name="B1"><br>
      <input type="button" value="   &lt;&lt;   "
      onclick="move(this.form.list4,this.form.list3)" name="B2"> </td>
      <td><select multiple size="5" name="list4">
      </select></td>
    </tr>
  </table>

<input type="button" value="Agregar" onclick = "this.form.action = 'guardar.php'; this.form.submit()">
</form>

</body>
</html> 
Tengo este ejemplo que encontre que me vino muy bien para lo que necesito hacer que pasa valores de un select multiple a otro, ahora mi pregunta ya que mucho no manejo de javascript, yo repito 3 veces la las cajitas para pasar datos porque lo necesito asi, como puedo hacer para tomar los valores de las cajas que estan a la derecha y para luego guardarlos en mi BD de mysql.

Gracias y espero alguien pueda ayudarme.

Saludos.

Última edición por roswell; 30/10/2006 a las 20:10
  #2 (permalink)  
Antiguo 30/10/2006, 19:59
Avatar de roswell  
Fecha de Ingreso: abril-2004
Ubicación: Buenos Aires
Mensajes: 80
Antigüedad: 20 años
Puntos: 0
Alguien sabe como podria hacerlo, estuve probando pero al realizar un post no me toma los valores.
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 00:43.