Ver Mensaje Individual
  #2 (permalink)  
Antiguo 23/09/2011, 13:52
Avatar de hmvr414
hmvr414
 
Fecha de Ingreso: marzo-2011
Ubicación: Santiago de Cali, Colombia
Mensajes: 74
Antigüedad: 13 años, 1 mes
Puntos: 16
Respuesta: Dialog y foco al siguiente input

prueba usando el evento close de dialog y el metodo focus de jquery:

Código Javascript:
Ver original
  1. function valida_mail(obj)
  2.     {
  3.         patron = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
  4.         if (!patron.test(obj.value))
  5.         {  
  6.             $("#error:ui-dialog").dialog("destroy");
  7.             $("#error").html('debe completar con un e-mail valido').dialog({
  8.                 modal: true,
  9.  
  10.                 close: function (event, ui) {
  11.                     $("#id-siguiente-input").focus();
  12.                 },
  13.  
  14.                 closeOnEscape:false,
  15.                 resizable: false,
  16.                 title:"ERROR!!!",
  17.                 buttons: {
  18.                     Ok: function() {
  19.                         $( this ).dialog( "close" );                          
  20.                         obj.value="";
  21.                        
  22.                     }
  23.                 }
  24.             })          
  25.                    }
  26.        
  27.     }