Yii Framework Forum: chosing city name from state name - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

chosing city name from state name

#1 User is offline   parmesh 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 10-June 12
  • Location:pune

Posted 11 June 2012 - 12:23 AM

hi guys
i am new to yii.i want to select city name from state name...
how i do that?
0

#2 User is offline   Ankit Gorasiya 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 14-June 12
  • Location:india

Posted 14 June 2012 - 11:24 PM

Hi


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

This is best


Regards
Ankit Gorasiya,
PHP & Yii Web Developer
Ankit
PHP Yii, Codeigniter developer
Gmail : ankit.gorasiya@gmail.com
Skype : ankit.gorasiya
0

#3 User is offline   Rajith R 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 884
  • Joined: 20-April 11
  • Location:India

Posted 20 June 2012 - 05:33 AM

View Postparmesh, on 11 June 2012 - 12:23 AM, said:

hi guys
i am new to yii.i want to select city name from state name...
how i do that?



use dependent dropdownlist...
Rajith Ramachandran,
Wiwo inc.
| Mobile: 919995504508
0

#4 User is offline   hemc 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 87
  • Joined: 09-July 12
  • Location:New Delhi

Posted 19 July 2012 - 07:32 AM

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
Please don't add a reply to say thanks, There is already a +1 button to do same.
0

#5 User is offline   Bynton 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 20
  • Joined: 09-July 12

Posted 21 July 2012 - 09:11 PM

use dependent drop down list or use ajax.
0

#6 User is offline   usersomu 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 15-September 12

Posted 15 September 2012 - 08:16 AM

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).
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users