开发者

How can I populate the textbox of an HTML file input?

This one has got me stumped. I am currently rendering a form using ASP MVC, it has a bunch of fields, one of them is an <input type="file"...

The file upload works great, but when I return the form to the user, the textbox that contains the file is empty. I would like to show the filepath in the textbox, but it appears the value field does not populate this textbox.

Ie. <input type="file" value="abc.txt" /> does not put "abc.txt" into the textbox.

How can I populate the te开发者_如何学编程xtbox of an HTML file input? Is there another property that I should be using other than the value property?

Any help would be much appreciated,


That textbox is readonly and you can't explicitly set the value of it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜