amor1980
02-19-2007, 02: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
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