E
E
EVOSandru62015-10-06 06:44:21
Yii
EVOSandru6, 2015-10-06 06:44:21

How in yii in CJuiAutoComplete, in addition to the value field, to pick up other form parameters?

I looked in the documentation www.yiiframework.com/doc/api/1.1/CJuiAutoComplete ,
How to pick up some other form elements in addition to the value of the input field, for example:
some

beforeWrite =>

addOtherTerms()
{
      'stars'=> $('#stars').val(),
      'country'=>$('#country').val(),
}

Fragment from the view:
<?php $this->widget('zii.widgets.jui.CJuiAutoComplete',
                    [
                        'name'=>'place_id',
                        'value'=>'',
                        'source'=>Yii::app()->createUrl('places/autocomplete'),
                        'options'=>
                            [
                                'showAnim'=>'fold',
                                'minLength'=>'3',
                                'select'=>'js:function( event, ui )
                                {
                                    $("#placeSearch").val( ui.item.label );
                                    $("#place_id").val( ui.item.id );
                                    searchHotel();
                                    return false;
                                }',
                            ],
                        'htmlOptions'=>
                            [
                                'onfocus' => 'js: this.value = null; $("#place_id").val(null); $("#selectedvalue").val(null);',
                                'class' => 'input-xxlarge search-query',
                                'name' => 'Hotels[place_id]',
                                'placeholder' => "Введите первые 3 и более буквы региона",
                                'id'=>'placeSearch'
                            ],
                    ]);
                ?>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question