I have develop jquery json autoxcomplete search there i want to terminate spaces when results coming . Currently when i search somthing placecing space infront it wont give any results. Please advice me how to add thsi option working
jQuery.extend( jQuery.ui.autocomplete.prototype, {
_renderItem: function( ul, item ) {
var term = this.element.val(),
regex = new RegExp( '(' + term + ')', 'gi' );
html = item.label.replace( regex , "<b>$&</b>" );
return jQuery( "<li></li>" )
.data( "item.autocomplete", item )
.append( jQuery("<a></a>").html(html) )
.appendTo( ul );
}
});
jQuery.noConflict();
jQuery(function(){
jQuery("#searchr").autocomplete({
source:'<?php echo JURI::root().'modules/mod_jomdirectory_search/tmpl/religious.php'; ?>',
minLength:1
});
});