Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Only autocomplete with a minimum of three characters
This topic contains 2 replies, has 2 voices, and was last updated by mokelage51 3 years, 4 months ago.
- AuthorPosts
- July 13, 2020 at 11:48 am #28409
Hi there!
Is there an option to define a minimal character count for the autocomplete feature? So you’d need to enter at least three characters before your word gets autocompleted.
If there is no such option, do you plan on adding it? Otherwise can you tell me where to look for individually implementing this feature?
Best,
MarcJuly 13, 2020 at 2:13 pm #28421Hi Marc,
There is no option for that unfortunately, we are not currently planning to add it either. Usually I recommend a custom code if possible, but there is no hook at the script location to add a bypass solution to this. The only way is to change the core files.
The autocomplete handler function is located in the wp-content\plugins\ajax-search-pro\js\nomin\jquery.ajaxsearchpro.js file, on lines 2320-2351.
You could add something like this:if ( $this.n.text.val().length < 3 ) return;
..before this line (2334):
var data = {
The javascript loading method has to be changed to Non minified for changes to populate, otherwise the minified file is loaded.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
July 29, 2020 at 10:18 am #28748Thank you very much, it works like a charm.
- AuthorPosts
You must be logged in to reply to this topic.