Hi,
I try to write the registrant members form and I use to this ajax. I have on the home page:
<div id="ajax"> </div> <?php echo CHtml::ajaxLink('Register',$this->createUrl('member/manage/register'),array('update'=>'#ajax')); ?>
My view file for register action is:
<?php $this->beginWidget('application.extensions.jui.EDialog', array( 'name' => 'register', 'theme' => 'smoothness', 'htmlOptions'=>array('title'=>'Register'), 'options' => array( 'autoOpen'=>true, 'show'=>'scale', ), 'buttons' => array( "Ok" => " function(){ var firstname= jQuery('#Member_firstname').val(); var email= jQuery('#Member_email').val(); var regAgree=''; if(jQuery('#Member_regAgree').is(':checked')) regAgree=1; jQuery.ajax({ type: 'POST', url: '".Yii::app()->createUrl('member/manage/register')."', data: 'Member='+firstname+'&Member='+email+'&Member='+regAgree, success: function(html){ jQuery('#register').html(html); }, beforeSend: function(){ }, complete: function(){ } }); } ", "Cancel" => 'function(){$('#register').dialog('close');}' ) ) ); ?> <?php echo $this->renderPartial('_register', array( 'member'=>$member, )); ?> <?php $this->endWidget('application.extensions.jui.EDialog'); ?>
I do not have the problem with registration but the problem is with thank`s page, because if I do redirect to ‘/’ in my controller, page show in div #register
$this->redirect('/');
Can someone write me what's wrong and how to solve this problem?
Thanx!