Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > HTML, Javascript y otros
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #3  
Antiguo 13-11-2007
Avatar de papulo
papulo papulo is offline
Miembro
 
Registrado: ago 2005
Ubicación: Lleida - Cataluña - España -Europa - Planeta tierra - Sistema solar - Via Lactea ...
Posts: 542
Poder: 22
papulo Va por buen camino
Aquí va "autocomplete"

Código PHP:
function autocomplete (thevalue, e){ 
         
        
theObject = document.getElementById("autocompletediv"); 
         
        
theObject.style.visibility = "visible"; 
        
theObject.style.width = "152px"; 
         
        var 
posx = 0; 
        var 
posy = 0; 
         
        
posx = (findPosX (document.getElementById("yourname")) + 1); 
        
posy = (findPosY (document.getElementById("yourname")) + 23); 
         
        
theObject.style.left = posx + "px"; 
        
theObject.style.top = posy + "px"; 
         
        var 
theextrachar = e.which; 
         
        if (
theextrachar == undefined){ 
            
theextrachar = e.keyCode; 
        } 
         
        
//The location we are loading the page into. 
        
var objID = "autocompletediv"; 
 
        
//Take into account the backspace. 
        
if (theextrachar == 8){ 
            if (
thevalue.length == 1){ 
                var 
serverPage = "html/index/autocomp.php"; 
            } else { 
                var 
serverPage = "html/index/autocomp.php" + "?sstring=" + thevalue.substr (0, (thevalue.length -1)); 
            } 
        } else { 
            var 
serverPage = "html/index/autocomp.php" + "?sstring=" + thevalue + String.fromCharCode (theextrachar); 
        } 
         
        var 
obj = document.getElementById(objID); 
        
xmlhttp.open("GET", serverPage); 
        
xmlhttp.onreadystatechange = function() { 
            if (
xmlhttp.readyState == 4 && xmlhttp.status == 200) { 
                
obj.innerHTML = xmlhttp.responseText; 
            } 
        } 
        
xmlhttp.send(null); 
    } 
__________________
"El aprendizaje potencia la intuición"
Yo mismo, en un momento de inspiración. v2.0
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Problemas con funciones de tiempo..cual es el error en este codigo rubencho PHP 5 29-04-2007 23:28:39
¿Por qué me da este error?Error creating cursor manejador nuri SQL 2 01-08-2005 18:30:28
podeis decirme porque no funciona este codigo?¿?¿? kassel PHP 4 14-02-2004 02:47:03
podeis decirme porque no funciona este codigo?¿?¿? kassel Conexión con bases de datos 1 26-01-2004 15:50:01
Por que no funciona este codigo en XP? kia Varios 3 15-10-2003 22:39:33


La franja horaria es GMT +2. Ahora son las 05:13:54.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi