Ver Mensaje Individual
  #15 (permalink)  
Antiguo 03/09/2014, 22:51
EdyArgueta
 
Fecha de Ingreso: abril-2014
Mensajes: 51
Antigüedad: 10 años, 9 meses
Puntos: 1
Respuesta: Reporte con filtros

Bueno el codigo es este

<script>

function mostrarInfo(variable, cod){
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("datos").innerHTML+=xmlhtt p.responseText;
}else{
document.getElementById("datos").innerHTML='Cargan do...';
}
}
xmlhttp.open("POST","conexion/cons_report2.php",true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send(variable + "=" + cod);
}

</script>

Y los select son los siguientes

<SELECT name="sol" id="sol" onchange="mostrarInfo('cod_banda1',this.value)">
<OPTION value="edy argueta">Edy Argueta</OPTION>
<OPTION value="Oscar Bueso">Oscar Bueso</OPTION>
</SELECT>


<SELECT name="tipo" id="materia" onchange="mostrarInfo('cod_banda2',this.value,)">
<OPTION value="matematicas">Matematicas</OPTION>
<OPTION value="espanol">Español</OPTION>
<OPTION value="ciencias">Ciencias</OPTION>
</SELECT>


y el cons_report2.php solo tengo para comprobar que las variables lleguen

$dato2=$_POST['cod_banda2'];
$dato1=$_POST['cod_banda1'];

echo $dato2;
echo $dato1;