Yii Framework Forum: Help On Dropdown List - Yii Framework Forum

Jump to content

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

Help On Dropdown List Rate Topic: -----

#1 User is offline   userp 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 28-January 13

Posted 29 January 2013 - 08:45 PM

Hi all,

I'm trying to populate values to a dropdown list. The value is taken from a table. Using the code below, I can only get 1 value from the table although there should be several values that should be displaying.

echo $form->dropDownList($model,'vendbus', CHtml::listData(padcd::model()->findAll('reftyp =:business',array(':business' => 'business')), 'reftyp','refval'), array('empty'=>'select Type')); ?>


Thanks in advance
0

#2 User is offline   yugene 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 506
  • Joined: 08-August 09

Posted 31 January 2013 - 07:50 AM

Hi, userp

Please use code formatting next time.
You're filling array having one key only: 'business'. Obviously, you'll have one value only in such array ;)
0

#3 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 2,045
  • Joined: 16-February 11
  • Location:Japan

Posted 31 January 2013 - 08:37 AM

/* Moved from "Yii-powered Applications" to "General Discussion for Yii 1.1.x" */
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