Yii Framework Forum: activeRadioButtonList() - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

activeRadioButtonList() Rate Topic: -----

#1 User is offline   krak3n 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 81
  • Joined: 17-February 09
  • Location:London, United Kingdom

Posted 07 April 2009 - 05:34 AM

Hi

I'm trying to build a radio button list, however it is not just a straight forward list, some of the radio buttons have text fields next to them for a user to complete if that radio button is selected.

Obviously a activeRadioButtonList() generates a list, which is great, but I need to be able to generate a list manually using activeRadioButton() so I can place the form elements I need to after each individual radio button.

It would need to look like the attachment.

I can't see a way of achieving this using the activeRadioButtonList or activeRadioButton as it seems activeRadioButton is just for 1 radio button that's not part of a list of radio buttons?

Is there a way to achieve this or should I just use html instead (which kinda negates the use of a model and makes my life much harder)

Chris

Attached File(s)

  • Attached File  form.jpg (18.7K)
    Number of downloads: 19

0

#2 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,901
  • Joined: 04-October 08
  • Location:DC, USA

Posted 07 April 2009 - 07:30 AM

For this kind of complex inputs, you should work on your own. ;)
0

#3 User is offline   krak3n 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 81
  • Joined: 17-February 09
  • Location:London, United Kingdom

Posted 07 April 2009 - 07:39 AM

oks, but what wuld be great for the future would be the ability to place radio buttons anywhere using activeRadioButton  with ability to tie them together into a list through the model :)
0

#4 User is offline   phazei 

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

Posted 19 September 2009 - 03:35 AM

View Postkrak3n, on 07 April 2009 - 07:39 AM, said:

oks, but what wuld be great for the future would be the ability to place radio buttons anywhere using activeRadioButton  with ability to tie them together into a list through the model :)



I came across the same issue and have been looking for a solution.
This seems to do the trick:
<?php $radio_options = CHtml::activeRadioButtonList($job,'jobType',$jobTypes, array('template'=>'{input}{label}','separator'=>'|'));
$radio_options = explode('|',$radio_options);
?>
<?php echo $radio_options[0] ?>
Details and stuff
<?php echo $radio_options[1] ?>
Details and more stuff
<?php echo $radio_options[2] ?>
Details and different stuff

0

#5 User is offline   long long ago 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 04-March 10

Posted 01 April 2010 - 04:14 AM

I have the same question!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

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