我有一个用于上传图片的表单:
<div class="col-sm-4">
<input id="file_input" type="file" style="visibility: hidden; width: 0; height: 0" name="image[photo_new]" accept="image/*">
</div>
<div class="col-lg-8">
<div class="form-group row">
<label class="col-sm-3 control-label" for="title">
<label for="image_title">Title</label>
</label>
<div class="col-sm-9">
<input id="title" class="form-control" type="text" placeholder="Title" name="image[title]" maxlength="200">
</div>
</div>
</div>
当用户点击#input_file
选择图片时,选择文件后,文件名将立即显示在#title
字段中。例如,name.png
应为name
。我想使用JQuery完成此功能,但不知道如何做,请给予建议。提前致谢。