Closed dmolineus closed 7 years ago
You mean the situation where you have multiple submit buttons and what to check which one got pressed?
That's not possible. The very first thing fetch()
does, is checking if the form was submitted: https://github.com/codefog/contao-haste/blob/master/library/Haste/Form/Form.php#L979
Yes, I'm talking about multiple submit buttons. I can't check which one was clicked. So the form was submitted but the submit button should not be return a value when being not clicked.
It could be the Contao core issue because the Haste Form does nothing special here apart from returning the value of submit widget like any other. I suggest to check it this way:
if (isset($_POST['submit'])) {
// ...
}
So this would be an issue in Contao\FormSubmit
widget?
Yes it is a Contao issue. @dmolineus I think you should report that issue directly to the https://github.com/contao/core
$form->fetch('submit');
of a submit field always returns the given value of the submit field no matter if it was submitted or not.