Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Form Dropdownlist Value Onchange

$
0
0
Hi All,

How do I trigger 'onchange' only when specific value is selected from the form dropdownlist?
I'm following Zaccaria's wiki/http://www.yiiframework.com/wiki/145/cjuidialog-for-cre in creating a pop-up dialog for user to create new type if it's not available in the list.

I have the following dropdownlist code in the create form.
How do I trigger 'onchange' only when the value 'addNew' is selected?
<?php 
echo $form->dropDownList($model,'type_id', 
                Dropdown::model()->getTypeAsset() + array('addNew'=>'Add New...'),			
                array('onchange'=>"{addDropdown(); $('#dialogDropdown').dialog('open'); return false;}"),				
		array('empty'=>array('prompt'=>'-- Select --'), )
);		
?>


Thank for any help.

Viewing all articles
Browse latest Browse all 18717

Trending Articles