Skip to content

Instantly share code, notes, and snippets.

@pjammer
Created May 30, 2012 08:51
Show Gist options
  • Save pjammer/9b6634b1b673022bab85 to your computer and use it in GitHub Desktop.
Save pjammer/9b6634b1b673022bab85 to your computer and use it in GitHub Desktop.
sample of autocomplete jquery ui
jQuery(".auto_search_complete").live("click", function() {
jQuery(this).autocomplete({
minLength: 3,
source: function (request, response) {
jQuery.ajax({
url: "/autocomplete.json",
data: {
term: request.term
},
success: function (data) {
if (data.length == 0) {
jQuery('span.guest_investor_email').show();
jQuery('span.investor_field_delete_button').show();
// what i thought would work but doesn't, as it does in other functions is:
// jQuery(this).siblings('span.investor_field_delete_button').show();
}
response(data);
}
});
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment