Possible Duplicate:
need gmail like functionailty - jquery autocomplete to include names and email addresses - in string searching
When user types in xxx
,autocomplete with a list of xxx@gmail.com,xxx@msn.com
and so on?
Possible Duplicate:
need gmail like functionailty - jquery autocomplete to include names and email addresses - in string searching
When user types in xxx
,autocomplete with a list of xxx@gmail.com,xxx@msn.com
and so on?
Try something like this:
var options = ['@gmail.com', '@msn.com', '@yahoo.com'];
$("input#autocomplete").autocomplete({
source: options
});
$("input#autocomplete").keyup(function() {
var new_options = [];
for (var i = 0; i < options.length; i++)
new_options[i] = $(this).val() + options[i];
$(this).autocomplete( "option", "source", new_options);
});
Look at it working here.