【发布时间】:2020-07-31 12:23:47
【问题描述】:
我想向我的 html 页面添加一个文件上传控件,如下所示。
<input class="form-control valid" id="rptScreenShot" type="text" style="float:left;" runat="server"
data-val="true" data-val-maxlength="The field Report Sample must be a string or array type with a maximum length of '600'."
data-val-maxlength-max="600" value="" aria-invalid="false" />
<label class="btn btn-default btn-file">
Browse <input class="form-control" id="upld_sample1" type="file" name="file_rptsample1" style="display: none;">
</label>
我无法做到的是在用户浏览文件后捕获所选文件并通过 javascript 或 jquery 将其设置为 rptScreenShot 的值。任何帮助将不胜感激。
【问题讨论】:
标签: javascript jquery html file-upload html-input