Ver Mensaje Individual
  #5 (permalink)  
Antiguo 25/09/2009, 12:49
Avatar de tampon
tampon
 
Fecha de Ingreso: julio-2009
Mensajes: 420
Antigüedad: 15 años, 6 meses
Puntos: 0
Respuesta: Problema con comparacion

Lo intente, no me manda error, pero sigue como en el principio, yo creo que el error se encuentra ahi, si quieres puedes darle una checada al codigo, no es muy largo.

Código js:
Ver original
  1. $(function() {
  2.     $('#consulta input[type:"text"]').keypress(function(e){return e.which!=13})
  3.     $(".search_button").click(function() {
  4.         var search_word = $("#search_box").val();
  5.         var dataString = 'search_word='+ search_word;
  6.         if(/^(\d{9}-\d{1})$/.test(search_word)){
  7.             $("#searchword").html('<font color="red"><i>La matricula no coincide con el formato, intente de nuevo.</i></font>');
  8.         }else
  9.         {
  10.             $.ajax({
  11.                 type: "GET",
  12.                 url: "consulta.php",
  13.                 data: dataString,
  14.                 cache: false,
  15.                 beforeSend: function(html) {
  16.                     document.getElementById("insert_search").innerHTML = '';
  17.                     $("#flash").show();
  18.                     $("#searchword").show();
  19.                     $("#searchword").html('Resultados de:&nbsp;<font color="green"><i>'+search_word+'</i></font>');
  20.                     $("#flash").html('<img src="img/load.gif" align="absmiddle">&nbsp;Realizando la busqueda...');
  21.                 },
  22.                 success: function(html){
  23.                     $("#insert_search").show();
  24.                     $("#insert_search").append(html);
  25.                     $("#flash").hide();
  26.                 }
  27.             });
  28.         }
  29.         return false;
  30.     });
  31. });