Forum Moderators: open

Message Too Old, No Replies

How to invoke the click() method in Netscape?

Not able to invoke the methods of other elements in Netscape

         

pvsas

10:45 am on Jul 19, 2004 (gmt 0)

10+ Year Member



Hi,

This is my first posting in this Forum. So request you to kindly ignore any mistakes I make in the post.

I am testing the <Input Type = "file"> tag in HTML.
My requirement is not to show the Browse button for the File Object (I want to keep the text box and also the Browse button as invisible).
Instead I want to use a Button which will invoke the click() method of the File Object.

The code I have written is
<html>
<form>
<input type="file" name="filebrowse" id="browse" style="visibility: hidden;">
<input type="button" onclick="filebrowse.click();" value="Browse">
</form>
</html>

This code is working fine in IE, but is not working in Netscape. Nothing happens when I click the Button.
I have checked the Javascript console in Netscape but no error is displayed in it.

Request you to kindly help me out with this.

Thanks and Regards
Sashi

BlobFisk

10:54 am on Jul 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, pvsas!

How about:

<input type="button" onclick="document.fromName.filebrowse.click();" value="Browse">

HTH

pvsas

11:06 am on Jul 19, 2004 (gmt 0)

10+ Year Member



Hi,

Thanks for the quick reply.

I tried the document.formname.filebrowse.click();
This doesnt work too in Netscape.

I also tried removing the style style="visibility: hidden;", but even this did not work.

Sashi