Thanks for the tip. I tried that but the error still seems the same :/
What I'm thinking will be the best bet will be to simply hide all the <li> elements and then show the first 3. Only seeing as I can only apply inline styles it doesn't work.
Is there any way I can run a function everytime .autocomplete is executed? I'm currently trying to hook a function on like so but it doesn't seem to be working:
- $("#franchisee_loc").autocomplete({
- source: tags,
- appendTo: "#ui-autocomplete-wrapper-02"
- });
- $('#franchisee_loc').on('autocomplete.init', function() {
- // show only first 3 items
- $('.ui-autocomplete li').css('display', 'none');
- $('.ui-autocomplete li').slice(0, 2).css('display', 'none');
- });
I get the following error:
$("#franchisee_loc").on is not a function
http://www.mattpealing.co.uk