[font="Arial"]Hello,
I’m trying to use CjuiAutocomplete widgets in replacement for dependant dropdownlists. (to select a brand, a model, and a version for a classifieds application)
here is my question :
my first autocomplete works well, it allows the user to select a brand.
My second one needs to display only models from the selected brand.
I figure I need to pass the brand_id to the autocomplete action through GET.
This can be done by passing an array to the widget :
$form->widget('zii.widgets.jui.CJuiAutoComplete', array(
'model'=>$model,
'attribute'=>'model_id',
'source'=>$this->createUrl('Ad/autocompleteModel', array('brand_id'=>"function() { $('#Ad_brand_id').val();}")),
// additional javascript options for the autocomplete plugin
'options'=>array(
'showAnim'=>'fold',
),
My problem is “function() { $(’#Ad_brand_id’).val();}” isn’t interpreted as Javascript, but just as a string…
Any idea how I can get the field value of brand_id in there?
Thanks a lot!
Cheers
[/font]