Ajax+jQuery Dropdown

I have a form with 10 and more input and select elements, and I want to update all fields, when one of the form elements changes. I've tried a couple of hours to find an elegant solution (one function in controller) to handle this problem, but I couldn't find anything.

In another project (which is not Yii-based) I solved it like doing this with xajax and jQuery:

$("input[@type='text'],select").change(

  function() {  

    xajax_changeElements(xajax.getFormValues('formSearch'));

  }

);

the ajax function "changeElements" updates all dropdowns width 1 request.

Is there any solution for doing something like this in Yii?

Why don't you do the same (xajax+jQuery) in Yii? It seems to me this is really about client-side scripting.

Quote

Why don't you do the same (xajax+jQuery) in Yii? It seems to me this is really about client-side scripting.

Sounds good :slight_smile:

Ok, I will try to integrate xajax into Yii. Hope I’ll get it work :D

EDIT:

Should xajax be installed into protected/vendors/xajax/ or in protected/extensions/xajax/?

Ok, I've installed Xajax under /protected/vendors/xajax/ and I think I've got it working now.

@qiang: I'm quite new to Yii, but at this point I can sait, that I love this framework. Thank you for your fast replies!

why use xajax ??? yii used JQuery and there is no need for use XAJAX

?

i can simple use AJAX with Yii