Answer the question
In order to leave comments, you need to log in
How to find out which form submit was clicked?
There is a form. There is a LaddaButtons plugin lab.hakim.se/ladda . There is a javascript code:
// Form submit
$(document).on('beforeValidate', 'form', function (event, messages, deferreds) {
var btn = $(this).find('[type=submit]');
btn.ladda();
btn.ladda('start');
}).on('afterValidate', 'form', function (event, messages, errorAttributes) {
if (errorAttributes.length) {
var btn = $(this).find('[type=submit]');
btn.ladda('stop');
alert('Сначала исправьте ошибки формы!');
}
}).on('beforeSubmit', 'form', function (event) {
var btn = $(this).find('[type=submit]');
btn.ladda('start');
});
Ladda.bind('.ladda-button');
yii.activeForm.js
event ?beforeValidate
Answer the question
In order to leave comments, you need to log in
Something is wrong with your interface if there is more than 1 submit in 1 form.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question