Yii Chtml::Radiobuttonlist - CSS to Align Horizontally

Yii CHtml::radioButtonList - CSS to align horizontally

Looks like you might need

div#gender input
{
float:left;
}

yii framework: how to i put a label to a radio button?

I got the code online! Sharing it of that it can be useful for someone in future

<?php echo  $form->radioButtonList($model,'radio',array('m'=>'male','f'=>'female'),array('separator'=>'', 'labelOptions'=>array('style'=>'display:inline'))); ?>

Yii: Issue in RadioButtonList

I think this article can help:

http://www.yiiframework.com/wiki/110/styling-radio-buttons/

Or even this one: http://code.dimilow.com/yii-radio-button-list-example-or-how-to-remove-the-line-break-separator/

Things that I notice in your code (Yii class reference):

  • Where is the model?
  • Where the select name?

Anyway, below an example of this, try take out your javascript code, to make easier figure out the problem:

<?php echo CHtml::radioButtonList($model, 'ck_Skill',
array(4 => 'Professional Skill', 5 => 'Suggestion'),
array('separator' => ' ',
'onChange'=>CHtml::ajax(array('type'=>'POST', 'dataType'=>'json',"url" =>array("search/search"),
"success"=>"function(response){
$('#textfield-wrapper').html(response.data);
}",
))));?>

Yii, radioButtonList disabling OR enabling dropDownList

Your question isn't related to yii realy. It's completely a javascript question and therefore has javascript based solutions. However, I think you should have an event handler for clicking on radiobutton:

$(document).ready(function(){
$('input[type=radio]').change(function(){
if(this.value == /* something */)
disableBox();
else
//function for enabling dropDownList
});
})

How to add another element to Yii radioButtonList template?

That's not possible with the current implementation. You have to loop over your list data and create the buttons manually with CHtml::radioButton() or CHtml::activeRadioButton().



Related Topics



Leave a reply



Submit