Click to See Complete Forum and Search --> : How do i open File upload dialog box on clicking image


tanveer
01-11-2003, 09:46 PM
Hi guys,

I wanted to know how do we open a file upload dialog box. on click of an image. Is there a way out. please let me know.

thanks!
tanveer

khalidali63
01-11-2003, 10:35 PM
The code below works only in IE.

Khalid


<html><head><title></title></head>
<body>
<img src="images/flake.gif" name="flake" onclick="openUploadFileDialogue();">
<script>
function openUploadFileDialogue(){
var frm = document.form1.upload;
if(document.all && document.getElementById){
document.form1.upload.click();
}
}
</script>
</body>
</html>

tanveer
01-12-2003, 09:11 PM
hi,

Thanks Khalid it works fine.

regards
tanveer

trishul.tandel
12-27-2007, 01:07 AM
The code below works only in IE.

Khalid


<html><head><title></title></head>
<body>
<img src="images/flake.gif" name="flake" onclick="openUploadFileDialogue();">
<script>
function openUploadFileDialogue(){
var frm = document.form1.upload;
if(document.all && document.getElementById){
document.form1.upload.click();
}
}
</script>
</body>
</html>






this code will not run in any browser.
so please understand me how this code will proceessed..
ok bye.
i have to problem for open dialog box on click of image