index.php file
<php
$('select').change(function(){
$('#gridDiv').show('fast');
$.fn.yiiListView.update('searchlist', {
data: $('form').serialize()
});
return false;
});
");
?>
<h1>Quick Search</h1>
<div class="search-form" style="width:100%">
<div style="width: 40%;float:left;">
<div >
<?php $this->renderPartial('_search1',array(
'model'=>$model,
)); ?>
</div><!-- search-form -->
</div>
<div style="width: 60%;float: right;">
<div id="gridDiv">
<?php $this->widget('zii.widgets.CListView', array(
'dataProvider'=>$model->search(),
'itemView'=>'_view',
'id'=>'searchlist',
)); ?>
</div>
</div>
</div>
and search1.php file like
<div>
<?php echo $form->label($model,'talentrgd_country_id'); ?>
<?php
$country = new CDbCriteria;
$country->order = 'country_name ASC';
?>
<?php
echo $form->dropDownList($model,'talentrgd_country_id',CHtml::listData(Country::model()->findAll($country),'country_id','country_name'),
array(
'prompt'=>'Select country',
'ajax' => array(
'type' => 'POST',
'url' => CController::createUrl('quicksearch/dynamicstates'),
//'update' => '#talentrgd_state_id',
'update'=>'#Quicksearch_talentrgd_state_id',
'data'=>array('talentrgd_country_id'=>'js:this.value'),
)
)
);
?>
<?php echo $form->error($model,'talentrgd_country_id'); ?>
</div>
<div>
<?php echo $form->label($model,'talentrgd_state_id'); ?>
<?php
$allState = new CDbCriteria;
$allState->order = 'state_name ASC';
echo $form->dropDownList($model,'talentrgd_state_id',CHtml::listData(State::model()->findAll($allState),'state_id','state_name'),
array(
'prompt'=>'Select State',
'ajax' => array(
'type' => 'POST',
'url' => CController::createUrl('quicksearch/dynamiccities'),
'update'=>'#Quicksearch_talentrgd_city_id',
'data'=>array('talentrgd_state_id'=>'js:this.value'),
) ));
?>
when i click on country it show right result for searching but it not working to get state by country
Please help
Thanks in advance
Page 1 of 1
Select Box Onchange For Select State By County And Onchange Search Result Not Working Simultaneously
#2
Posted 30 January 2013 - 04:07 AM
Wrap your code within code tag for better view.
[/code]
[code] code here
[/code]
VINAY Kr. SHARMA
@vinaykrsharma
Facebook ID: vinaykrsharma
Blog
Co-operation comes from friendship, friendship comes from trust, and trust comes from kind-heartedness.
@vinaykrsharma
Facebook ID: vinaykrsharma
Blog
Co-operation comes from friendship, friendship comes from trust, and trust comes from kind-heartedness.
Share this topic:
Page 1 of 1