Código Javascript
:
Ver original<html>
<head>
<title>Pruebas</title>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" type="text/css" media="all" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" type="text/javascript"></script>
<script>
$( function(){
var availableTags = ["ActionScript","AppleScript","Asp","BASIC","C","C++","Clojure"];
$(".busqueda" ).autocomplete({
source: availableTags
});
var inputs = $(":text, :file, :button, textarea", '#formulario');
inputs.live('keydown', function(e) {
if($(this).is(".ui-autocomplete-input")) return true;
else{
if (e.keyCode == 40 ){
var $this = $(this);
if($this.index() == inputs.length - 1)
inputs.eq(0).focus();
else
saltear($this.next()).focus();
return false;
}
}
});
function saltear(el){
if(el.is('.busqueda, :disabled')){
return saltear(el.next());
}
return el;
}
});
</script>
</head>
<body>
<form id="formulario">
<input type="text" />
<input type="text" />
<input type="text" disabled="disabled" value="disabled" />
<input type="text" class="busqueda" value="Autocompletar" />
<textarea>textarea</textarea>
<input type="file" />
<input type="button" value="boton" />
</form>
</body>
</html>