user2205196
user2205196

Reputation: 113

yii dropdownlist affecting display

I am still new to the yii framework, and I manage to get my dropdownlist working, but I can't figure out from research or documentation. How to make my dropdownlist selected value effect what is going to be display to the screen in a text area.

<div class="row">
        <?php 
            echo CHtml::dropDownList("teamName", 'id', Chtml::listData($model->memberOfTeams, 'id', 'teamName'),array(
                'empty'=>'Select Team',
                'ajax'=>array(
                    'type'=>'POST', // request type
                    'url'=>CController::createUrl(''), // url to call
                    'update'=>'#teamMessage' // selector to update
                    )
                )
            ); 
        ?>
    </div>

Upvotes: 0

Views: 464

Answers (1)

jmarkmurphy
jmarkmurphy

Reputation: 11473

You are trying to use ajax without a request back to the server. It sounds like you really just want to execute a javascript function with the onchange attribute.

<div class="row">
    <?php 
        echo CHtml::dropDownList("teamName", 'id', Chtml::listData($model->memberOfTeams, 'id', 'teamName'),
            array(
                'empty'=>'Select Team',
                'onchange'=>'jsFunction()',
            )
        ); 
    ?>
</div>

Upvotes: 1

Related Questions