2011-03-03 15 views

Respuesta

42

informa extensamente:

$('input:not(:disabled):not([readonly])').each(function() { 
    $(this).foo(); 
}); 

O mejor:

$('input:enabled:not([readonly])').each(function() { 
    $(this).foo(); 
}); 

EDIT: Desde su siguiente respuesta, hay un mejor manera de hacer lo que quiere hacer:

$('input').focus(function(e) { 
    if($(this).is(':disabled, [readonly]')) { 
     $(this).next().focus(); 
     e.preventDefault(); 
    } 
}); 
0

realmente yo necesitaba siguientes:

$('input:not(input:enabled:not([readonly]))').each(function() { 
//skip focus to readonly input 
    $(this).focus(function(){ 
     $(this).nextAll('input:enabled:not([readonly])')[0].focus(); 
    }); 
}); 
+1

Usted debe echar un vistazo a mi respuesta actualizada. Hay una forma más limpia de hacer eso. – Eric

Cuestiones relacionadas