Our Blog

News, thoughts & useful links

Contact: Skype , email or call
+44 (0) 131 556 6818

Symfony: Ajax.Autocompleter is not a constructor

January 4th, 2009 by Anton

If you use Symfony and its Autocomletion feature, you may get the following error: "Ajax.Autocompleter is not a constructor"

There could be two reasons for this:

  1. Necessary JS libraries are not loaded. To fix make sure you load the following libraries (example below is for including them from the action):
    
    $response->addJavascript('/sf/js/prototype/prototype');
    $response->addJavascript('/sf/js/prototype/effects');
    $response->addJavascript('/sf/js/prototype/controls');
    
  2. You could be including Prototype JS library twice. So for the example above I am adding a prototype JS library. In addition to that I could have added it to be added in the view.yml file. This would have caused the "Ajax.Autocompleter is not a constructor".


Comments are closed.