buenas un favor tengo este formulario de con listas desplegables, como puedo aplicarle la busqueda:
<?php include "conexion.php";?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
</head>
<script>
//hacer que funcione con diferentes navegadores
function requerir(){
try{
req=new XMLHttpRequest();
}catch(err1){
try{
req=new ActiveXObject("Microsoft.XMLHTTP");
}catch(err2){
try{
req=new ActiveXObject("Msxml2.XMLHTTP");
}catch(err3){
req= false;
}
}
}
return req;
}
var peticion=requerir();
function llamarAjaxGETpro(){
var aleatorio=parseInt(Math.random()*999999999);
valor=document.getElementById("departamento").value;
var url="provincia.php?valor="+valor+"&r="+aleatorio;
peticion.open("GET",url,true);
peticion.onreadystatechange =respuestaAjaxpro;
peticion.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
peticion.send(null);
}
function llamarAjaxGETdis(){
var aleatorio=parseInt(Math.random()*999999999);
valor=document.getElementById("provincia").value;
var url="distrito.php?valor="+valor+"&r="+aleatorio;
peticion.open("GET",url,true);
peticion.onreadystatechange =respuestaAjaxdis;
peticion.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
peticion.send(null);
}
function respuestaAjaxpro(){
if(peticion.readyState==4){
if(peticion.status==200){
//alert(peticion.responseText);
document.getElementById("pro").innerHTML=peticion.responseText;
}else{
alert("ha ocurrido un error"+peticion.statusText);
}
}
}
function respuestaAjaxdis(){
if(peticion.readyState==4){
if(peticion.status==200){
//alert(peticion.responseText);
document.getElementById("dis").innerHTML=peticion.responseText;
}else{
alert("ha ocurrido un error"+peticion.statusText);
}
}
}
</script>
<body>
<form action="" method="post" enctype="application/x-www-form-urlencoded" name="form1" id="form1">
<div id="dep" style="width:150px; float:left">
<select name="departamento" id="departamento" onchange="llamarAjaxGETpro()">
<option>seleccione depart.</option>
<?php
$re=mysql_query("select * from tb_departamento");
while($f=mysql_fetch_array($re)){
echo'<option value="'.$f['id_dep'].'">'.$f['det_dep'].'</option>';
}
?>
</select>
</div>
<div id="pro" style="width:150px; float:left">
<select disabled="disabled">
<option>seleccione provincia</option>
</select>
</div>
<div id="dis" style="width:150px; float:left">
<select name="select3" id="select3" disabled="disabled">
<option>seleccione distrito</option>
</select>
</div>
</form>
</body>
</html>
me funciona bien al desplegar las listas, todo k hasta hay, pero deseo que me aparesca la busqueda de mi tabla usuarios, y como puedo agregar otra lista desplegable despues de distrtitos que en total sean 4 listas desplegables, mil gracias a todos
<?php include "conexion.php";?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
</head>
<script>
//hacer que funcione con diferentes navegadores
function requerir(){
try{
req=new XMLHttpRequest();
}catch(err1){
try{
req=new ActiveXObject("Microsoft.XMLHTTP");
}catch(err2){
try{
req=new ActiveXObject("Msxml2.XMLHTTP");
}catch(err3){
req= false;
}
}
}
return req;
}
var peticion=requerir();
function llamarAjaxGETpro(){
var aleatorio=parseInt(Math.random()*999999999);
valor=document.getElementById("departamento").value;
var url="provincia.php?valor="+valor+"&r="+aleatorio;
peticion.open("GET",url,true);
peticion.onreadystatechange =respuestaAjaxpro;
peticion.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
peticion.send(null);
}
function llamarAjaxGETdis(){
var aleatorio=parseInt(Math.random()*999999999);
valor=document.getElementById("provincia").value;
var url="distrito.php?valor="+valor+"&r="+aleatorio;
peticion.open("GET",url,true);
peticion.onreadystatechange =respuestaAjaxdis;
peticion.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
peticion.send(null);
}
function respuestaAjaxpro(){
if(peticion.readyState==4){
if(peticion.status==200){
//alert(peticion.responseText);
document.getElementById("pro").innerHTML=peticion.responseText;
}else{
alert("ha ocurrido un error"+peticion.statusText);
}
}
}
function respuestaAjaxdis(){
if(peticion.readyState==4){
if(peticion.status==200){
//alert(peticion.responseText);
document.getElementById("dis").innerHTML=peticion.responseText;
}else{
alert("ha ocurrido un error"+peticion.statusText);
}
}
}
</script>
<body>
<form action="" method="post" enctype="application/x-www-form-urlencoded" name="form1" id="form1">
<div id="dep" style="width:150px; float:left">
<select name="departamento" id="departamento" onchange="llamarAjaxGETpro()">
<option>seleccione depart.</option>
<?php
$re=mysql_query("select * from tb_departamento");
while($f=mysql_fetch_array($re)){
echo'<option value="'.$f['id_dep'].'">'.$f['det_dep'].'</option>';
}
?>
</select>
</div>
<div id="pro" style="width:150px; float:left">
<select disabled="disabled">
<option>seleccione provincia</option>
</select>
</div>
<div id="dis" style="width:150px; float:left">
<select name="select3" id="select3" disabled="disabled">
<option>seleccione distrito</option>
</select>
</div>
</form>
</body>
</html>
me funciona bien al desplegar las listas, todo k hasta hay, pero deseo que me aparesca la busqueda de mi tabla usuarios, y como puedo agregar otra lista desplegable despues de distrtitos que en total sean 4 listas desplegables, mil gracias a todos