This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Autocomplete in Ajax-Forms

Forum to discuss ExtJS and other JS plugins

Autocomplete in Ajax-Forms

by coco_ka » Fri Mar 27, 2009 6:22 pm

Hi,

I try to develop a dynamic ajax form containig an autocomplete field. Here is the idea:

I want to load a form dynamically via a link_to_remote function:

Code: Select all
link_to_remote('addEvent',array('update'=>'myForm',
                                'url'=>'myModule/addEvent');


myForm is a hidden div field which has to be update by my form workflow.

Now my addEvent action has a template addEventSuccess.php

Code: Select all
<?php echo  input_auto_complete_tag('select_autocomplete_title','','myModule/autocompleteEvent',
            array(   'autocomplete' => 'off'),
            array(   'use_style' => 'true')); ?>


If I call the action directly through my browser, the autocomplete field works fine. But calling it through the link_to_remote function has no success.

Any ideas how to fix this problem?

If I use it directly within my main template, there is no problem at all, but for a complex workflow I want to use the autocomplete field within different action templates.

Kind regards,
Christian
coco_ka
Junior Member
 
Posts: 2
Joined: Fri Mar 27, 2009 6:08 pm
Location: Karlsruhe

Re: Autocomplete in Ajax-Forms

by coco_ka » Fri Mar 27, 2009 8:38 pm

Okay, I found a solution by adding the script=true option to the Ajax.Updater.

But for some reason it only works, if I use the Autocompleter-Class in a hidden form in my mainpage. What do I have to include in my response to avoid this?
coco_ka
Junior Member
 
Posts: 2
Joined: Fri Mar 27, 2009 6:08 pm
Location: Karlsruhe