As mentioned in the documentation, the way to use client side validation is by using activeform to create the form.
I have a field for file upload in my forms that I can’t create it with the activeform so I use Html::activeFileInput. Is there any way to create client side validation for my file field with yii utilities that activeform uses?
There is a typo in the title I mean client side validation without activeform
There is a typo in the topic. I’m sorry about the mistake. To use client side navigation, we have to use ActiveForm widget to generate the form. The problem is, in my case I can’t use ActiveForm and I used Html::activeFileInput to create the field.
ActiveForm widget generates the client scripts to validate form inputs, but Html::activeFileInput doesn’t generate client scripts for validation.