Take the tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

i am writting the javascript function like this

 function PreviewImg(imgFile, labelid,frameid) {
labelid.innerHTML = imgFile.value;
document.getElementById('btnupload').click();
}

Above code document.getElementById('btnupload').click(); is the error but firfox browser is supported but i have support IE8 , pls give me suggestion error is htmlfile: Access is denied.

share|improve this question
 
use JQuery for fuly cross-browser javascript ! –  Davide Piras Oct 22 '11 at 10:41
add comment

2 Answers

up vote 2 down vote accepted

this one also works for me.

document.getElementById('ctl00_btnupload').click();

but you can test it by yourself. Good luck..

share|improve this answer
 
It is also not working same error occured –  hmk Oct 24 '11 at 6:57
 
try this one: document.getElementById('<%=btnUpload.clientID%>').click(). may be this one working. –  spiritUMTP Nov 9 '11 at 5:51
add comment
document.getElementById('<%= btnupload.ClientID %>').click();
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.