Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
158
rated 0 times [  161] [ 3]  / answers: 1 / hits: 15705  / 13 Years ago, sun, may 29, 2011, 12:00:00

I have tried this, (note that I am using jQuery):



function HandleFileButtonClick()
{
1. //$('#filesel').click();
2. //document.replyform.image.click();
}


HTML:



<input type=file id=filesel name=image style=display: none;  /> 
<a href=#><img src=<?=TF?>/img/att.png style=height:20px; onclick=HandleFileButtonClick(); /></a>


neither are working in Google Chrome Browser... any ideas, or a replacement for jQuery click()


More From » jquery

 Answers
24

Sounds like you are hitting a security wall designed to only allow the file upload box to be triggered by the user.



You could try absolutely positioning the browser's browse button over your link, and then setting its opacity to 0.


[#91994] Friday, May 27, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
payton

Total Points: 307
Total Questions: 96
Total Answers: 83

Location: Saint Vincent and the Grenadines
Member since Sat, Sep 11, 2021
3 Years ago
;