<form id="starterWizard__form" class="starterWizard__form" action="/wizard/step1?id=19623" method="post"></form>
<!-- my form fields -->
<input type="submit" class="btn btn-primary" name="Events[submitbutton]" value="Save and Exit" form="starterWizard__form">
<input type="submit" class="btn btn-primary" name="Events[submitbutton]" value="Continue" form="starterWizard__form">
In my controller I want to implement different logic based on which submit button is used to post the form. But the problem is that I don’t see “submitbutton” in $_POST. Any idea why this doesn’t work in Yii framework? If I test it in a plain php file without Yii then it works.
I have tried generating markup for submit buttons using both ActiveField and Yii Helpers and neither works. Below is my Yii code for submit buttons:
This issue seems to be due to javascript that Yii runs in the page. If I comment out the following line of script in the page, then problem gets resolved.
@smohadjer Sure it is. You linked to it yourself. It’s activated by default.
On github, alex-code mentioned it too.
Are you sure you fully understand the process?
Yes, I already resolved this issue using feedback I got on github issue that I had opened. All I had to do was to set “enableClientScript” to false, so I’m not affected by the bug in ActiveForm JavaScript. When no javascript is loaded, the form works flawlessly with two submit buttons even when they sit outside the form.