开发者

How to set text in file (html input type)

How can we set text in html file uploader.

Is it possible开发者_Python百科 using JavaScript?


You cannot. The value attribute is ignored, and the DOM value property is readonly.

Otherwise <input style="display: none" type="file" name="mine-now" value="path-to-some-common-sensitive-file">


You cannot set this (security reasons - only user can select file in browser ), but if you need it you can clear this field using this script:

$get('FileUploadCtrlId').outerHTML="<input type=file style='WIDTH: 400px' id ='FileUploadCtrlId'>"

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜