开发者

Jquery: change input file value inside an iframe

开发者 https://www.devze.com 2023-03-25 05:21 出处:网络
I have a page where there is an input file. In this page there also is an iframe that contains another input file.

I have a page where there is an input file. In this page there also is an iframe that contains another input file.

So, when the input file in main page changes, I want that the input file inside iframe also changes its value to the value of external input file.

But it doesn't work, i use this code in main page:

$('#iframe').contents().开发者_高级运维find('#input_file').val(myvalue);

The value of #input_file file remains empty. What could be the problem


You cannot change the value of a file input (for security reasons).

See: Dynamically set value of a file input

0

精彩评论

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