Add onchange to input inside template yii2 fileInput
<p>I am using file upload in yii2 with default yii2 fileInput().
The code is:</p>

<pre><code>$form-&gt;field($model, 'image', [
       'template' =&gt; "&lt;span class='button'&gt;{input}Browse&lt;/span&gt;&lt;input type='text' placeholder='Include some files' readonly=''&gt;"
       ])-&gt;fileInput(['multiple' =&gt; false, 'accept' =&gt; 'image/* '])-&gt;label(false);
</code></pre>

<p>Here I use custom template as above. The problem is that {input} generates input field automatically, but I want to add an onchange attribute to this input. Is it possible? Any help would be appreciated. Thanks</p>