开发者

input type File Alternative button using JQuery click function

开发者 https://www.devze.com 2023-02-17 19:31 出处:网络
I开发者_如何学Python was trying to make a custom file upload button using the JQuery click function as seen here.

I开发者_如何学Python was trying to make a custom file upload button using the JQuery click function as seen here.

onclick="$('input[name=thumbfile]').click()"

<input id="thumbfile" name="thumbfile" type="file" value="upload" class="input" onchange="this.form.submit();"/>

Works fine in Safari but not in Firefox.

Any ideas.

Marvellous


Firefox 3.6 doesn't support script clicking the file input element. Firefox 4 does allow it assuming that it's not blocked by its popup blocker; you'll be OK if you're just redirecting the click from another element.

0

精彩评论

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