...

View Full Version : Help with this.click(); function in mozilla/firefox



amor1980
02-19-2007, 03:15 PM
Hi,

I'm trying to open a dialog box by clicking on an image. When a user clicks on an image....it open the Hidden HTMLINPUTFILE...and then a user selects an image and the the image that he clicked on initially will be replaced with the image he selected from the dialog box....now this works fine in IE....but the click event does not work in firefox......has anybody encountered this problem....

can anybody help me with the workaround here or if there is any other solution to do what i want to achieve....

This is the code i use....

<script language="javascript">
function t()
{
document.getElementById('test').click();
}
function tt()
{
document.getElementById('imgxyz').src = document.getElementById('test').value;

}
</script>

<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:Button id="Button1" runat="server"
Text="Button"></asp:Button><INPUT onclick="t();"
type="button" value="Button"><INPUT type="file" onchange="tt();" id="test"><IMG width="50" height="50" onclick="t();" id="imgxyz"
alt="" src=""> </form>
</body>

Thanks in advance.

Cheers

DH2006
02-19-2007, 06:34 PM
Hi!
Maybe this helps

eval(document.getElementById('test').attributes["onchange"].value);

or maybe you want
eval(document.getElementById('test').attributes["onclick"].value);


Greetings
Dieter
---
:)

amor1980
02-19-2007, 07:50 PM
Hi,

Thanks for the reply.....but what i'm doing above is that...when i click the image...i call the Input File CLick event so that the dialog box opens up.....it works great in IE...but not in Firefox.....

Please help!

Thanks

Regards

Mr J
02-19-2007, 08:24 PM
Sorry, my suggestion did not work either

amor1980
02-19-2007, 08:36 PM
Hi,

Thanks for the reply.

I tried it...did not work......

Please copy my code and test it on IE by clicking the Image.......and then test it on Mozilla....you will know what i need....

Cheers

amor1980
02-21-2007, 12:23 PM
Hi,

ANybody with a solution to my problem......

please help...its urgent...

thanks

regards



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum