Yii Framework Forum: Radio buttons in CForm - Yii Framework Forum

Jump to content

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

Radio buttons in CForm asking help Rate Topic: -----

#1 User is offline   docc 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 45
  • Joined: 07-July 10

Posted 13 July 2010 - 10:15 AM

i have CForm like this
<?php
return array(
	'title' => Yii::t('Personal', 'Please provide your personal information.'),
	'elements' => array(
		'cvid' => array(
			'type' => 'hidden',
		),
		'appID' => array(
			'type' => 'hidden',
		),
		'firstName' => array(
			'type' => 'text',
		),
		'surName' => array(
			'type' => 'text',
		),

		'address' => array(
			'type' => 'text',
		),
		'postalCode' => array(
			'type' => 'text',
		),
		'city' => array(
			'type' => 'text',
		),
		'phone' => array(
			'type' => 'text',
		),
		'email' => array(
			'type' => 'text',
		),
		'gender' => array(
			'type' => 'radiolist',
			//'options' => array(
			//'name' => 'gender',
			'options'=>array(
				'type'=>'radio', //'value'=> 'male',
				//'value'=>'female',
			),


And I cant figure out how could I get radio button for gender?
0

#2 User is offline   whoopass 

  • Advanced Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 119
  • Joined: 27-May 09
  • Location:Ajax, Ontario, Canada

Posted 13 July 2010 - 06:34 PM

View Postdocc, on 13 July 2010 - 10:15 AM, said:

i have CForm like this
<?php
return array(
	'title' => Yii::t('Personal', 'Please provide your personal information.'),
	'elements' => array(
		'cvid' => array(
			'type' => 'hidden',
		),
		'appID' => array(
			'type' => 'hidden',
		),
		'firstName' => array(
			'type' => 'text',
		),
		'surName' => array(
			'type' => 'text',
		),

		'address' => array(
			'type' => 'text',
		),
		'postalCode' => array(
			'type' => 'text',
		),
		'city' => array(
			'type' => 'text',
		),
		'phone' => array(
			'type' => 'text',
		),
		'email' => array(
			'type' => 'text',
		),
		'gender' => array(
			'type' => 'radiolist',
			//'options' => array(
			//'name' => 'gender',
			'options'=>array(
				'type'=>'radio', //'value'=> 'male',
				//'value'=>'female',
			),


And I cant figure out how could I get radio button for gender?


I can't find any reference to a radio button through CForm for versions 1.1.x only through CActiveForm

http://www.yiiframew...ioButton-detail
0

#3 User is offline   docc 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 45
  • Joined: 07-July 10

Posted 14 July 2010 - 05:03 AM

View Postwhoopass, on 13 July 2010 - 06:34 PM, said:

I can't find any reference to a radio button through CForm for versions 1.1.x only through CActiveForm

http://www.yiiframew...ioButton-detail


Actually i found it my self, its like this
		'gender' => array(
			'type' => 'radiolist',
			'items'=> array(
				'0' =>'male', '1'=>'female',
			),

		),

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