Discussion Locked

Invoke click on fileupload in Netscape

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I need to hide the file object for some reason and use a button/text/hidden file combination instead. This code is workign perfectly in IE. But Netscape... there nothing happenign there... Can anyone tell me the alternative method to invoke the click in netscape(6+ is fine) or and alterative way to do this???

Here is the eg. code...

2 replies

by jay eckles

View any Javascript faq for the basic answer on this one. The short answer is that for security reasons, you can't programatically manipulate the file-type input element. The fact that you can invoke click() on it in IE is a bug.

Try this faq:http://developer.irt.org/script/script.htm
You'll probably want to look under the "Form" category.

by niteshn

I've heard that for security reasons the value attribute of the file object cannot be set. But that u cannot invoke click !!! Well click invoke is not a bug in IE. it is a browser dependent method provided by IE only, which Netscape (seems like) is not supporting. Invoking a click of the file object cannot be security error bcoz it'll just open a choose file dialog box. Even in the faqs u have given above, u have an entry about this (http://developer.irt.org/script/780.htm) which says u can do it with the same method i've used above.

This discussion is closed to new replies.