Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/08/2012, 08:27
Avatar de JoseReynel
JoseReynel
 
Fecha de Ingreso: julio-2012
Ubicación: Bogota
Mensajes: 2
Antigüedad: 11 años, 9 meses
Puntos: 0
Capturar OPC select guardar en Var PHP

hola buenos dias companieros...mi pregunta es sobre como hacer para sin refrescar la pagina y solamente al cambiar el select de opcion quede almacenado en una variable de php normalita... le he dado vueltas y nada q consigo q me almacene... espero q alguien me pueda ayudar con esta tematica..... Gracias de antemano !

adjunto codigo fuente generado hasta el MO.

print"<form action=\"" . $_SERVER['PHP_SELF'] . "\" method=\"post\">
<select id=\"selectid\" name=\"selectid\"onchange=\"getData()\";\>\n";

while ($row = mysql_fetch_row($resultado)) {
//print "<option value=\"\">$row[0]</option>\n";
$a = 1;
while ($a <= $row[0]) {
print "<option value=\"$a\">$a</option>\n";
$a++;
}
}

print "</select>\n<br>


</form>";
?>
<script type="text/javascript">
function getData() {
*var oCombo = document.getElementById('selectid');
*var iValue = oCombo.value;
}
</script>

<?php
$variablephp = "<script> document.write(oCombo) </script>";
echo "variablephp = $variablephp";
?>