Revision #5 has been created by samdark on Jan 20, 2019, 9:12:14 PM with the memo:
Set version
« previous (#4)
Changes
Title
unchanged
How to display Dependent drop-down value using ajax call with dynamically
Category
unchanged
Tutorials
Yii version
changed
1.1
Tags
changed
drop down list, ajax link, search, #dropdown
Content
changed
[...]
**1)** First we have to create the two table and insert the some sample data
```php
CREATE TABLE `country_master` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,[...]
```php
CREATE TABLE `state_master` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,[...]
```php
<?php echo CHtml::hiddenField('hidden_state',$model->state);?>
```[...]
```php
<div class="control-group">
<?php echo $form->label($model,'country',array('class'=>'control-label')); ?>[...]
```php
<div class="control-group">
<?php echo $form->label($model,'state',array('class'=>'control-label')); ?>[...]
```php
public function actionDynamicStates()
{[...]
```php
class UtilityHtml extends CHtml{[...]
```php
<?php
Yii::app()->clientScript->registerScript('countryload','jQuery(function($) {
$("#VkUsers_country").trigger("change");
$("#VkUsers_state").val(\''.$model->state.'\');
});[...]