Getting values of a form in a autocomplete controller without submiting the form


I'd like to get values of the fields filled in a form after an event in an autocomplete input

I know that there is a attribute called "extraParams" in the widget of autocomplete and I can get the values I pass in this attribute in the autoComplete controler using $_GET.

But how can I set values filled in other fields in the form by the user in the attribute  "extraParams" ?

Or is there anyway I can get the values of the other fields of the form in the autocomplete controller ?

My autocomplete field is working I just want to know how can I get the values of the other fields and pass theses to autocomplete controller.

Any ideas ?


Somebody cracked this nut already?

If you would write the call to the JQuery autocomplete in Javascript than you can use the following code to pass additional field values:

$("#states").autocomplete(url, {

   extraParams: {

       country: function() { return $("#country").val(); }



But how do you generate this kind of code using the CAutocomplete class? The documentation is refering to the above solution but what should be the exact syntax?



The syntax is:

‘country’=>‘js:function() { return $("#country").val(); }’

where #country is a reference to a formfield with id = "country"