Answer the question
In order to leave comments, you need to log in
How to pass value from ActiveForm validation to JavaScript?
How to return a value to JavaScript from attribute validation in ActiveForm so that it can be processed?
public function validateCoupon($attribute)
{
return 0.2;
}
$('#test-form').on('afterValidateAttribute', function (event, attribute, messages) {
console.log(messages);
});
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