What I am trying to accomplish is manipulating the content of the input fields of an ActiveForm which has already been rendered on the browser, from PHP code executed on the server under certain circumstances.
Being a newbie with using Yii, I thought about exploiting the ajaxValidation which is present in my ActiveForm as a hook where my code could decide whether or not to change the value of a field in the model AND as a result in the input fields of the ActiveForm.
But this is not the case, as I found, because the result of ActiveForm::validate
is just an array of errors, in my case empty.
I could try and find a solution with AJAX and JS, but I think it won’t be as a reusable approach as one would want.
Is there any preferred way from Yii to refresh/update the input fields of an ActiveForm which has already been rendered on the browser, from PHP code executed on the server?