jquery - Autocomplete not allowing spaces -
i using autocomplete in site this:
$(document).ready(function(){ $('input[type="text"]').each(function(){ var $this = $(this); $this.autocomplete({ minlength: 1, source: "{site_url}publish/my_autocomplete?key=" + $this.attr('id') }) }); })
it working fine when there word 'harley motor' , if have typed 'ey ' space not displaying. suggestions how can select harley motor
typing ey
trailing space?
the url needs escaped, since not have issue:
blank spaces in ajax request jquery
you need escape:
source: escape("{site_url}publish/my_autocomplete?key=" + $this.attr('id'))
Comments
Post a Comment