Beispiel #1
0
?>
        <?php 
echo $form->dropDownList($model, 'country', CountryStates::getCountries(), array('prompt' => 'Select Country', 'ajax' => array('type' => 'POST', 'url' => Yii::app()->createUrl('countries/dynamicStates'), 'data' => array('country' => 'js: $("#Clients_country option:selected").val()'), 'update' => '#Clients_state'), 'live' => false));
?>

        <?php 
echo $form->error($model, 'country');
?>
    </div>

    <div class="row">
        <?php 
echo $form->labelEx($model, 'state');
?>
        <?php 
echo $form->dropDownList($model, 'state', CountryStates::getCountryStates($model->country), array('empty' => 'Select'));
?>
        <?php 
echo $form->error($model, 'state');
?>
    </div>

    <div class="row">
        <?php 
echo $form->labelEx($model, 'city');
?>
        <?php 
echo $form->textField($model, 'city', array('size' => 60, 'maxlength' => 256));
?>
        <?php 
echo $form->error($model, 'city');