chosing city name from state name

hi guys

i am new to yii.i want to select city name from state name…

how i do that?

Hi

You simple to solve using ajax with (jQuery & Javascript) .

This is best

Regards

Ankit Gorasiya,

PHP & Yii Web Developer

use dependent dropdownlist…

use dependent link like this





<?php echo $form->dropdownList($model1,'id', 

	

	CHtml::listData(promo::model()->findAll(), 'id', 'promoName'),

	array(

	'empty'=>'select option',

	'ajax'=>array(

	'type'=>'POST',

	'url'=>CController::createurl('loadtemp'),

	

	'update'=>'#view_t',

	

	))); 

	?>







echo cHtml::dropDownList('view_t','');




here action for populating the second dropdown run by ajax call on selecting first dropdown list

use dependent drop down list or use ajax.

the best way of adding your city to yii is using dropdown list like, there are tables named cities,states and countries–when you select coutry list of states is filled into second dependant dropdown box

i.e states dropdownbox. Rather than you can use ajax((jQuery & Javascript).