I start learning yii and try to make some changes in others' code. I want to add the submitButton function into other button (Complete submission button)
if ($page == $pageCount) {
echo CHtml::submitButton("Save", array('class' => 'btn', 'name' => 'files', 'title' => 'Save the updates to these files'));
?>
<form action="/dataset/submit" method="post" style="display:inline">
<input type="hidden" name="file" value="file">
<input type="submit" value="Complete submission" class="btn-green" title="Submit changes to file details."/>
</form>
Which action is related to this button?
echo CHtml::submitButton("Save", array('class' => 'btn', 'name' => 'files', 'title' => 'Save the updates to these files'));
How can i add the Save button function into the Complete submission button ?
You can set all sorts of html options for your button after label, as an array, like:
echo CHtml::submitButton('Submit' , array(
'onclick' => 'yourFunction()',
'id' => 'btnSubmit',
.
.
.
));
http://www.yiiframework.com/doc/api/1.1/CHtml#submitButton-detail