I have reached a roadblock and hope one of the YII experts can help.
2 JUI Radio Buttons (Button Set) on a view are supposed to switch out a partial view. I was hoping I could just call a controller action when one of the radio buttons is clicked to achieve this. The action is supposed to re-render the view with a different partial view.
This is all happening on the logon form (see attachment). I want to allow people to logon or to sign up. logon needs less fields than sign up, also a different model (LogonForm versus User).
Is this possible?
Here is the code:
<?php
$this->beginWidget(‘zii.widgets.jui.CJuiButton’, array(
‘buttonType’=>‘buttonset’,
‘name’=>‘my-set’,
‘themeUrl’=> Yii::app()->theme->baseUrl . ‘/jquery-ui-1.8.22.custom/css’ ,
‘theme’=>‘buttonset’,
));
$this->widget(‘zii.widgets.jui.CJuiButton’, array(
‘name’=>‘modeRadio’,
‘id’=>‘radio1’,
‘caption’=>‘sign up’,
‘buttonType’=>‘radio’,
‘value’=>array(‘checked’=>‘checked’) ,
‘htmlOptions’=>array(‘value’=>‘SIGNUP’),
‘onclick’=>‘js:function(){$.ajax({type: “POST”,url: “http://localhost/yii/TeamDynamics/index.php?r=site/switch”}); }’,
));
$this->widget(‘zii.widgets.jui.CJuiButton’, array(
‘name’=>‘modeRadio’,
‘id’=>‘radio2’,
‘caption’=>‘login’,
‘buttonType’=>‘radio’,
‘htmlOptions’=>array(‘value’=>‘LOGIN’),
‘onclick’=>‘js:function(){$.ajax({type: “POST”,url: “http://localhost/yii/TeamDynamics/index.php?r=site/switch”}); }’,
));
$this->endWidget();
?>
Thank you,
Dieter