Answer the question
In order to leave comments, you need to log in
How to detect which button was clicked in beforeValidate event in Yii2?
There was such a situation. There is a form and 2 submit buttons, which should lead to a different effect.
In the first case, everything is standard and the beforeValidate event should work in full (there is, in fact, the process of generating a certain alert).
In the second case, this alert must be disabled.
The first thing that comes to mind is to determine which button was pressed in the form's beforeValidate event. But I did not find access to such information inside the handler. This is real?
If not, are there other ways to introduce such conditional logic on form submission?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question