
15/04/2011, 10:56
|
 | | | Fecha de Ingreso: abril-2011
Mensajes: 8
Antigüedad: 13 años, 10 meses Puntos: 0 | |
Consulta En Seleccionar elementos en lista y enviarlos a pagina php Hola. alguien podria orientarme en cuanto a este codigo de javascript.
Código:
<?php
require("ClaseFuncionRespaldos.php");
$funcion = new Respaldos();
?>
<html>
<head>
<title>Selecciona elementos en lista</title>
<p align="center"><b>Seleccionar Seriales De Mantenimiento</b></p>
<style>
.inputF {
width=170;
height=150;
background-color:#CCCCCC;
}
.inputF2 {
width=170;
background-color:#CCCCCC;
}
.listCell{
background-color:#CC0000;
layer-background-color: #FCFE52;
}
.selCell {
background-color:#7073FE;
border-style:inset;
border-width:1px;
border-left-color:white;
border-top-color:white;
border-bottom-color:black;
border-right-color:black;
}
H6 {
COLOR: white; FONT-FAMILY: Arial, helvetica CE, helvetica; FONT-SIZE: 8pt; FONT-STYLE: normal; FONT-WEIGHT: normal
}
TABLE {
COLOR: black;
FONT-FAMILY: Arial, helvetica CE, helvetica;
FONT-SIZE: 9pt;
FONT-STYLE: normal;
FONT-WEIGHT: normal;
display: block;
}
SELECT {
COLOR:#CC0000; FONT-FAMILY:Calibri; FONT-SIZE: 14pt; FONT-STYLE: normal; FONT-WEIGHT: normal;
}
</style>
<script languaje="JavaScript">
function moveVals(n, from, to) {
if (document.layers) {
fromObj = document.layers[from];
to = document.layers[to];
} else if (document.all) {
fromObj = document.all(from);
to = document.all(to);
}
if (n == 1 || n == 2) {
var indTo = to.length-1;
for (i=fromObj.length-1; i>=0; i--) {
if (n==1 || fromObj.options[i].selected) {
indTo++;
to.options[indTo] = new Option(fromObj.options[i].text, fromObj.options[i].value);
fromObj.options[i] = null;
}
}
} else if (n == 3 || n == 4) {
var indFrom = fromObj.length-1;
for (i=to.length-1; i>=0; i--) {
if (n==4 || to.options[i].selected) {
indFrom++;
fromObj.options[indFrom] = new Option(to.options[i].text, to.options[i].value);
to.options[i] = null;
}
}
}
}
function frmButtons() {
var select = "chosen";
var avail = "avail";
if (document.layers) {
var sel = document.layers[select];
var av = document.layers[avail];
} else if (document.all) {
var sel = document.all(select);
var av = document.all(avail);
}
if (sel.length <= 0) {
document.formulario.btnR.disabled = true;
document.formulario.btnRR.disabled = true;
} else {
document.formulario.btnR.disabled = false;
document.formulario.btnRR.disabled = false;
}
if (av.length <= 0) {
document.formulario.btnL.disabled = true;
document.formulario.btnLL.disabled = true;
} else {
document.formulario.btnL.disabled = false;
document.formulario.btnLL.disabled = false;
}
}
function deleteFrom() {
for (i=0; i<document.formulario.elements.length-1; i++) {
if (document.formulario.elements[i].tagName.indexOf("SELECT") && document.formulario.elements[i].id.indexOf("av")) {
alert("Cislo: "+i+" Name: "+document.formulario.elements[i].tagName);
}
}
}
</script>
</head>
<body>
<center>
<form name="formulario" method="post" action="recibe-prueba.php">
<table height="172">
<tr>
<td WIDTH="170" CLASS="selCell" style="background-color: #FFFFFF" height="14">
Seriales De Mantenimiento Disponibles</td>
<td bgcolor="#FFFFFF" height="14"></td>
<td WIDTH="170" CLASS="selCell" style="background-color: #FFFFFF" height="14">
Seriales Escogidas</td>
</tr>
<tr>
<td height="150">
<select multiple class="inputF" name="avail" id="av">
<?php
$regs=$funcion->buscar_mantenimientos();
if($regs==0)
{ $filas="No Hay Mantenimientos En La BD"; }
else
{
$v1=$nom;
while($filas=$funcion->extraer_man() )
{
foreach ($filas as $opciones) {
?>
<option><?php echo "$opciones<br>";} } } ?></option>
</select>
</td>
<td ALIGN="CENTER" VALIGN="CENTER" height="150">
<input TYPE="button" VALUE=">>" STYLE="{width=25;}" NAME="btnLL" onClick="javascript: moveVals(1, 'avail', 'chosen'); frmButtons(); return false;"><br>
<input TYPE="button" VALUE=">" STYLE="{width=25;}" NAME="btnL" onClick="javascript: moveVals(2, 'avail', 'chosen'); frmButtons(); return false;"><br>
<input TYPE="button" VALUE="<" STYLE="{width=25;}" NAME="btnR" onClick="javascript: moveVals(3, 'avail', 'chosen'); frmButtons(); return false;"><br>
<input TYPE="button" VALUE="<<" STYLE="{width=25;}" NAME="btnRR" onClick="javascript: moveVals(4, 'avail', 'chosen'); frmButtons(); return false;">
</td>
<td height="150"><select multiple class="inputF" name="chosen"></select>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="btnagregar" value="Agregar"></td>
</tr>
</table>
</form>
</center><br>
<script>
frmButtons();
</script>
</body>
</html>
Lo Que quisiera saber es como pasar los valores que recibe el select llamado 'chosen' a otra pagina en php, para asi poderlos almacenar en una BD.
Por Favor. Ayuda
Última edición por ing_green_hornet; 15/04/2011 a las 11:08 |