Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/04/2010, 14:15
Leogl
 
Fecha de Ingreso: noviembre-2009
Mensajes: 113
Antigüedad: 14 años, 6 meses
Puntos: 0
Definir tipo de datos CHAR

hola tengo el siguiente problema.
el siguiente codigo, funciona cuando tengo numeros, pero cuando intento pasar letras no anda. que puede ser? como hago para que sea compatible.

Código Javascript:
Ver original
  1. // JavaScript Document
  2. function  nuevoAjax(){
  3.     var xmlhttp=false;
  4.     try{
  5.         xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  6.     }catch(e){
  7.         try {
  8.             xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  9.         }catch(E){
  10.             xmlhttp = false;
  11.         }
  12.     }
  13.  
  14.     if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  15.         xmlhttp = new XMLHttpRequest();
  16.     }
  17.    
  18.     return xmlhttp;
  19. }
  20.  
  21. function buscarDato(){
  22.     resul = document.getElementById('resultado');
  23.     bus=document.frmbusqueda.dato.value;
  24.    
  25.     ajax=nuevoAjax();
  26.     ajax.open("POST", "busqueda.php",true);
  27.     ajax.onreadystatechange=function() {
  28.         if (ajax.readyState==4) {
  29.             resul.innerHTML = ajax.responseText
  30.         }
  31.     }
  32.     ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  33.     ajax.send("busqueda="+bus)
  34.  
  35. }