"Object doesn't support this action" on calling Ajax.autocompleter

115 Views Asked by At

I'm trying to use the autocompleter from http://madrobby.github.io/scriptaculous/ajax-autocompleter/

  function autoSuggest(inputTagId, divTagId) {

            new Ajax.Autocompleter(inputTagId, divTagId, '/tmptypeaheadservlet', null);
     }

But it throws as error "Object doesn't support this action" when the Ajax.Autocompleter is called.

Edit:

Here is how the function is getting called:

   onkeypress="autoSuggest('Line_<%=OrderLineCounter%>','autoCompleteMenu_<%=OrderLineCounter%>')"
2

There are 2 best solutions below

4
ftshtw On

Did you try changing null with {} ? The function needs an empty object, not a null.

Also id's should be in quotes: new Ajax.Autocompleter("autocomplete", "autocomplete_choices", "/url/on/server", {});

1
Harvey Zhang On

Is back end exception? if back end exception ,you can check the action method parms.