Ver Mensaje Individual
  #6 (permalink)  
Antiguo 22/08/2011, 09:25
Avatar de informacionsys
informacionsys
 
Fecha de Ingreso: mayo-2011
Ubicación: Bogota D.C
Mensajes: 793
Antigüedad: 13 años
Puntos: 76
Respuesta: No me muestra ningun textbox

Hola

Lo que quieres hacer es cargar el archivo Actualiza.php que tiene los campos en un div ....

pero si te fijas el div que quieres cargar no esta por ningun lado o por lo menos yo no lo veo...

mas o menos quedaria asi:

contrasena.php


Código:
<html>
<head>
<title>Actualizacion de Contraseña</title>
<script language="JavaScript" type="text/javascript" src="Ajax.js"></script>
</head>
<body>

<form action="Actualiza.php" method="post">

<center><h2>ACTUALIZACION DE CONTRASEÑA</h2></center>

<h4><center>Aqui podra realizar el cambio de contraseña</center></h4>

<center><h3>Nombre Persona: <?php 

                   require("Conexion.php");

                            $sql = "SELECT DISTINCT `Nombre_Persona`FROM `personas`";

                            $result = mysql_query($sql, $Conexion);

                           echo "<select name=listas onchange=javascript:peticion_ajax() id="nom">";

                            echo "<option value='0'>Seleccionar Nombre</option>"; 
                
                            while ($row=mysql_fetch_array($result)){

                            echo "<option value=".$row['Cod.Persona'].">".$row['Nombre_Persona']."</option>";
                           
                    }

                            echo"</select>";

                    echo"</form>";
                     
                   ?>
    
</center>

<div id="cargar"></div>

<div align="center"><a href="MenuAdmi.php"><h3> Devlover </h3></a></div>

</body>

</html>
Ajax.js


Código:
// Objecto HTTPREQUEST 

function obj_xml_http_request(){

$obj = false;

try{
	$obj = new XMLHttpRequest();
	}catch(error1){
		try{
			$obj = new ActiveObject("Msxml2.XMLHTTP");
			}catch(error2){
				try{
					$obj = new ActiveObject("Microsoft.XMLHTTP");
					}catch(error3){
						$obj = false;
						}
				}
		}
return $obj;
}

//  instanciamos o creamos el objeto 

peticion = obj_xml_http_request();

// funcion para hacer la peticion al servidor 

function peticion_ajax(){
rand = parseInt(Math.random()*99999999);
url = "ActualizaContra.php";
datos = ""; // son los datos que le quieres enviar 
peticion.open("GET",url + "?" +  datos   + "&rand=" + rand,true);
peticion.onreadystatechange = function(){
	
	   if(peticion.readyState == 4){
				 if(peticion.status == 200){
					 
					       
						// cargas el div con el resultado de la peticion 	 	 
				               document.getElementById('cargar').innerHTML = peticion.responseText;
							   
				}else{
					alert("Error al procesar la solicitud en el servidor" + peticion.statusText); // cuando falla algo en la solicitud 
				}
			 }
		   }	
		}
peticion.send(null);
}
Lo que esta en negrita es el div que quieres cargar... cualquier duda me comentas