diff --git a/js/jquery.fastautocomplete.js b/js/jquery.fastautocomplete.js
index 36de16a..e0128c7 100644
--- a/js/jquery.fastautocomplete.js
+++ b/js/jquery.fastautocomplete.js
@@ -246,10 +246,15 @@
       seeAllLink = resultList.find('> li.see-all-link');
     }
 
+    // Trim the result to the maximum length.
+    if (value.length > settings.keyMaxLength) {
+      value = value.substring(0, settings.keyMaxLength);
+    }
+
     // Only perform the ajax call if the key is a certain length and not
     // empty. Append a timestamp to the url to prevent the browser caching
     // the json response.
-    if (value.length >= settings.keyMinLength && value.length <= settings.keyMaxLength) {
+    if (value.length >= settings.keyMinLength) {
       $(element).trigger('fac:requestStart');
       facJsonRequest = $.ajax({
         url: settings.jsonFilesPath + value + '.json?nocache=' + (new Date()).getTime(),
