Skip to content

Instantly share code, notes, and snippets.

@abuiles
Created August 31, 2010 03:45
Show Gist options
  • Save abuiles/558514 to your computer and use it in GitHub Desktop.
Save abuiles/558514 to your computer and use it in GitHub Desktop.
$('input[autocomplete]').each(function(i){
$(this).autocomplete({
source: $(this).attr('autocomplete')
});
$(this).bind( "autocompleteselect", function(event, ui) {
log(ui.item ? (ui.item.value + " id: " + ui.item.id) : "Nothing selected, input was " + this.value);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment