Answer the question
In order to leave comments, you need to log in
Yii2 how to catch click on a specific button?
I have a form, it has 2 submit buttons
. Depending on which button the user pressed, I need to make an entry in the database.
That is, he clicked on one button, we put an additional flag in the database and save the form.
Clicked on another, just save the form without an additional flag.
So this is how to track click in php in yii2
How to implement it?
Not well with the button is clear. And then how to make changes to the database on click
Answer the question
In order to leave comments, you need to log in
As Alexey Ukolov said above .
There will be something like $_POST['form_name']['button_name'] and, depending on the pressed button, set the flag
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question