Yii Framework Forum: Cascading dropDownList using just arrays - Yii Framework Forum

Jump to content

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

Cascading dropDownList using just arrays Rate Topic: -----

#1 User is offline   unagi2020 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 22-July 10

Posted 22 July 2010 - 07:18 AM

Hello

I want to use Cascading DropDownList using just two set arrays without having to make an Ajax calls. Is it possible?

I have a following drop down. Based on country selected, I want show list of states in the selected country
echo CHtml::dropDownList('country-id', '',
array('US' => 'America',
'CA' => 'Canada',
'JP' => 'Japan',
));

echo CHtml::dropDownList('state-id', '',
array('US-CA' => 'California',
'US-FL' => 'Florida',
'CA-AL' => 'Alberta',
'JP-KA' => 'Kansai',
));



Thanks in advance
0

#2 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 22 July 2010 - 08:49 AM

You can do so with jquery, just google for it. There's even an extension here:
http://plugins.jquer...DependentSelect

BTW: The "Miscellaneous" section of this forum would be the right place for these questions. "Tips, Snippets and Tutorials" is for exactly this: Useful Tipps, Snippets and Tutorials someone wants to share.
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