Submit Button Redirect To Some Action

Hello!, i have some problem, i need button "submit" , when i click this button inside some view, this redirect me to some ation .

Problem is there, when i doesn’t want button “yii” type “Chtml::Button” , i need some that “<input type=“submit”>” witch after click , redirect me to some action inside some controller.

How do it? Thanks !

CHtml::submitButton() generates the sort of button you’re looking for. You’d need to use javascript to capture the click if you want to do something other than submit the form.

see

http://www.yiiframework.com/doc/api/1.1/CHtml#submitButton-detail

OR

http://www.eha.ee/labs/yiiplay/index.php/en/site/widget?view=button

Hi,

If I got your issue correctly, You should add a action parameter to form section to redirect form submission to desired controller / action. You can use delivered YII Submit button. Following is the code




<?php $form=$this->beginWidget('CActiveForm', array(

'id'=>'newsletter-form',

'action'=>Yii::app()->createUrl('controller/action'),

'enableAjaxValidation'=>false,

)); ?>