Yii Framework Forum: Dependent Control Value To Display And Save To Db - Yii Framework Forum

Jump to content

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

Dependent Control Value To Display And Save To Db Rate Topic: -----

#1 User is offline   venuk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 25
  • Joined: 15-February 13

Posted 02 March 2013 - 10:18 AM

This is tricky question
I have two drop downs one for state and one for city.
I am able to populate state dropdown using the below code
<code>
<?php echo $form->dropDownListRow($model, 'state_name', GxHtml::listDataEx(State::model()->findAllAttributes(null, true)),array('class'=>'span3')); ?>
</code>

Now I want to pass the above selected value as state_id to the below drop down and populate it.
echo $form->dropDownListRow($model, 'city', GxHtml::listDataEx(City::model()->findAllAttributes(null, true,'state_id=1')),array('class'=>'span3')); ?>

Is it possible?
I know there is a way create a dependent drop down but I am looking for easy solution to populate and save value to database on form submit

I am new to this technology.. any help much appreciated
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