Jquery UI autocomplete accessing the search term
Hi,
The search event handler does not have any control over the search term.
I came into this problem, when I just wanted to trim the search term before search is performed. But I could not do it inside the search event-handler. Can someone please elaborate it a bit?
- search: function( value, event ) {
- value = value != null ? value : this._value();
- // always save the actual value, not the one passed as an argument
- this.term = this._value();
- if ( value.length < this.options.minLength ) {
- return this.close( event );
- }
- if ( this._trigger( "search", event ) === false ) {
- return;
- }
- return this._search( value );
- },