Reputation: 712
In Drupal 7 website. I don't want to call ajax for autocomplete if entered string length is less than 3 characters.
I have written the Jquery like this
$('#name').keyup( function( e ) {
if( $.trim( $('#edit-enterprise-ids').val().length ) < 3){
return false;
}
});
But it is not working, If I write alert(''); in place of return false it works. But I don't want to have alert there. Please help.
Upvotes: 1
Views: 524
Reputation: 1156
Try using the Autocomplete Limit module here: https://www.drupal.org/project/autocomplete_limit
Upvotes: 1