Yii CHtml submitButton Save function <p>I am using two buttons. The first one is a button to save all data in a form:</p> <pre><code>echo CHtml::submitButton("Save", array('id'=&gt;'btSubmit','class' =&gt; 'btn', 'name' =&gt; 'files', 'title' =&gt; 'Save the updates to these files')); </code></pre> <p>The second one is to complete a submission:</p> <pre><code>&lt;form action="/dataset/submit" method="post" style="display:inline"&gt; &lt;input type="hidden" name="file" value="file"&gt; &lt;input type="submit" value="Complete submission" class="btn-green" title="Submit changes to file details." onclick="btSubmit."/&gt; &lt;/form&gt; </code></pre> <p>When I click the complete submission button, I want the code to first run the save button function and then run the post submit function. However, I don't know how to use the CHtml::submitButton onClick in the other button. How can I solve this issue?</p>