Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / CSS / August 2007



Tip: Looking for answers? Try searching our database.

Image Browse Button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shapper - 25 Aug 2007 17:07 GMT
Hello,

Is there a way to make the browse button an image?

Thanks,
Miguel
Beauregard T. Shagnasty - 25 Aug 2007 17:11 GMT
> Is there a way to make the browse button an image?

What browse button would that be?

Do you have a URL to something relevant?

Signature

  -bts
  -Motorcycles defy gravity; cars just suck

Steve Swift - 25 Aug 2007 20:32 GMT
> Is there a way to make the browse button an image?

Two easy ways:

<INPUT TYPE=IMAGE SRC=smiley.gif onClick="alert('Ouch! My nose!')">
<P>
<BUTTON onClick="alert('You clicked the button')">Click: <IMG
SRC=/smiley.gif></BUTTON>

They both have drawbacks, if you plan to submit the form, and not just
use onClick events as I have above:

1. The <INPUT TYPE=TEXT> generates X and Y co-ordinates within the
   image. Whatever handles the form has to know what to do with these
2. The <BUTTON> sends some very non-standard form data if the browser is
   Internet Explorer. Easier to rely only on the NAME of the button
   (which I didn't include above).

You can see this page working at http://swiftys.org.uk/image.html

Signature

Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk

Ben Bacarisse - 26 Aug 2007 01:42 GMT
>> Is there a way to make the browse button an image?
>
[quoted text clipped - 4 lines]
> <BUTTON onClick="alert('You clicked the button')">Click: <IMG
> SRC=/smiley.gif></BUTTON>

I think the OP wants to know how to style the button that often
accompanies <input type=file>.

I don't have an answer since I prefer to leave controls as they are to
aid in recognition, but I can help clarify the objective.

Signature

Ben.

Rik - 26 Aug 2007 03:50 GMT
>>> Is there a way to make the browse button an image?
>>
[quoted text clipped - 7 lines]
> I think the OP wants to know how to style the button that often
> accompanies <input type=file>.

If that's the question: no, it cannot be done. You cannot style the  
'browse' button reliably.
Signature

Rik Wasmus

shapper - 26 Aug 2007 23:45 GMT
> >>> Is there a way to make the browse button an image?
>
[quoted text clipped - 12 lines]
> --
> Rik Wasmus

Yes, I want to style the button that accompanies <input type=file>.

I have seen this one or twice and it seemed to work fine ...

Any idea?

Thanks,
Miguel
Michael Fesser - 27 Aug 2007 01:31 GMT
.oO(shapper)

>Yes, I want to style the button that accompanies <input type=file>.

There's no reliable way to do that.

>I have seen this one or twice and it seemed to work fine ...

Most likely an ugly JavaScript hack.

Micha
shapper - 26 Aug 2007 23:52 GMT
> >>> Is there a way to make the browse button an image?
>
[quoted text clipped - 12 lines]
> --
> Rik Wasmus

Hi,

Here is an ASP.NET control that does just that:

http://www.telerik.com/demos/aspnet/Upload/Examples/Overview/DefaultCS.aspx

A few demos:
http://www.telerik.com/demos/aspnet/Upload/Examples/Skinning/DefaultCS.aspx
http://www.telerik.com/demos/aspnet/Upload/Examples/AdditionalFields/DefaultCS.aspx

This seems to work fine.

How is this done? Any idea?

Thanks,
Miguel
rf - 27 Aug 2007 01:45 GMT
>> >>> Is there a way to make the browse button an image?
>>
[quoted text clipped - 24 lines]
>
> This seems to work fine.

Nope. They don't work fine.

> How is this done? Any idea?

They are overlaying (z-index) a normal <input type=file> with an <input
type=text> and an <input type=button> and styling the button. They are not
styling the <input type=file> button which is, of course, generated by the
browser.

I didn't research the javascript skulduggery that must be going on behind
the scenes.

Signature

Richard.

Gregor Kofler - 29 Aug 2007 12:16 GMT
shapper meinte:

> Here is an ASP.NET control that does just that:
>
[quoted text clipped - 7 lines]
>
> How is this done? Any idea?

Get yourself some tools and find out yourself.
I'd suggest FireBug and DomInspector. It's easy. Really.

Gregor

Signature

http://www.gregorkofler.at ::: Landschafts- und Reisefotografie
http://www.licht-blick.at  ::: Forum für Multivisionsvorträge
http://www.image2d.com     ::: Bildagentur für den alpinen Raum

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.