Yii:RadioButtonList中的问题

时间:2013-05-18 11:59:27

标签: php yii radiobuttonlist

radioButtonList中的问题。我有两个radio按钮,如下所示。我正在对第一个单选按钮执行AJAX操作。

但是当我尝试点击第二个单选按钮时,第一个没有取消选中,我无法检查第二个。

<?php echo CHtml::radioButtonList( '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);
     }",
))));?>

我在这里缺少什么?

1 个答案:

答案 0 :(得分:0)

我认为这篇文章可以提供帮助:

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

甚至这一个:http://code.dimilow.com/yii-radio-button-list-example-or-how-to-remove-the-line-break-separator/

我在代码中注意到的事情(Yii class reference):

  • 型号在哪里?
  • 选择名称在哪里?

无论如何,在下面的一个例子中,尝试取出你的javascript代码,以便更容易找出问题:

<?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);
     }",
))));?>