...

View Full Version : Calling a Browse Dialog without an Input Button



nick_a
10-18-2006, 06:58 PM
A little explanation of what Im trying to do. Say a user on a particular site has an image as their avatar. Now when they edit their profile they have the option to change that image.

Is it possible to call the Browse dialog (so they can choose a new local file to use as their avatar) without using the "Browse" input button? Ideally they would be able to click the existing image and that would act as the Browse button.

Is there a way to call that Browse action without using a form and input button?

Thanks in advance for any insight.

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

Have you had any luck with this solution?

I too am having similar problems....

Cheers

Bobafart
02-19-2007, 04:08 PM
why don't you want to do this in the first place? is it just for aesthetics?

if it is there are lots of ways to do it..

how about having a pop-up division that display the browse dialog?

amor1980
02-19-2007, 06:51 PM
Hi,

Thanks for the reply....But can you please suggest with some sample code....

this is what i'm doing...

<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>


Now what i want is that when i click the image ......i call the Input File CLick event so that the dialog box opens up for me to select the image.....it works great in IE...but not in Firefox.....

Please help....

thanks

cheers

amor1980
02-20-2007, 07:59 AM
Hi,

Can anybody please help me....its urent...

Thanks

Regards

amor1980
02-21-2007, 11:24 AM
Hi,

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

please help...its urgent...

thanks

regards

_Aerospace_Eng_
02-21-2007, 02:03 PM
There isn't one. You can't call the browse dialog box without the input with type="file". Maybe this will help
CSS2/DOM - Styling an input type="file" (http://www.quirksmode.org/dom/inputfile.html)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum