a HTML can have a name attribute, which is passed when submitting a form, e.g.
has $_POST[‘myOwnSubmit’] set when clicking the button. Is there a simple way to achieve something similar in Agile UI buttons?
I am using a “hack” to make the Autocomplete autosubmittable, see https://github.com/atk4/ui/issues/321. It submits the form on change as a normal $autocomplete_field->on(‘change’, …) does not work.
Now I am using an AutoComplete somewhere else where the “real” form submit should do something quite different, so inside the submit function I need to determine whether the AutoComplete caused the submit or clicking the button. As the AutoComplete might pass an empty value, I need to determine if the button was clicked by passing some value with it.
Maybe some small change to onClick Eventhandler? $form->buttonSave->on(‘click’, $form->js()->form(‘submit’, ‘someExtraParameter’)) ?