hello,
i want to add a js function in the submitbutton
<?php echo CHtml::submitButton(Yii::t($ss, 'next'));?>
like this
<input type=submit value=next onclick="jsfunction()">
how can i do it?
hello,
i want to add a js function in the submitbutton
<?php echo CHtml::submitButton(Yii::t($ss, 'next'));?>
like this
<input type=submit value=next onclick="jsfunction()">
how can i do it?
use the htmlOptions parameters
http://www.yiiframework.com/doc/api/CHtml#submitButton-detail
<?php echo CHtml::submitButton(Yii::t($ss, 'next'), array('onclick' => 'jsfunction()'));?>
or you could use the jquery
<?php
Yii::app()->clientScript->registerCoreScript('jquery.js');
Yii::app()->clietnScript->registerScript('function', '
$(\'#submitbutton\').click(function(){
//do somefunctions
});
');
//
echo CHtml::submitButton(Yii::t($ss, 'next'), array('id' => 'submitbutton'));
good~thks