Difference between #4 and #5 of
How to display Dependent drop-down value using ajax call with dynamically

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.'\');
});
[...]
1 1
6 followers
Viewed: 50 588 times
Version: 1.1
Category: Tutorials
Written by: Ankit Modi
Last updated by: samdark
Created on: Jul 23, 2014
Last updated: 5 years ago
Update Article

Revisions

View all history