Ajax-fetched page cannot use input type="file" tag?
PHP中文网
PHP中文网 2017-05-19 10:26:40
0
2
530

I get the form page through Ajax.
The following is the form code:

    <form  method="post" enctype="multipart/form-data" class="form-horizontal">
        <p class="form-group" style="margin-left:0px;">
            <label for="file">注:选择头像文件尽量小于2M</label>
            <input id="headPortraitFile" type="file" name="portrait"> 
        </p>
        <button id="headPortraitSubmit" type="button" class="btn-sm btn-primary">上传头像</button>
    </form>

But the input type="file" in this form cannot directly select the file in the browser, let alone submit the file. Do not know what is the reasons of that? I haven't been able to solve it in the past two days. Please ask for help! ! !

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(2)
洪涛

Hmm, I don’t see any problems with the form page. Is there something wrong with loading and rendering this code after getting it?

给我你的怀抱

I tried it, dynamically adding input can select files. How did you add it to the page?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!