Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 14th, 2004, 08:50 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default <INPUT type="file" (why does style not work)

Why does the following form element tag allow no style?

I would have thought:
<INPUT type="file" name="UploadFile" size="50">

could be written like so:
<INPUT type="file" name="UploadFile" class="someName" size="50">

I am getting sick of the gray buttom it produces (allowing a file upload)

How can I put a style on this tag?
objective = change the color of the button

TYIA

Wind is your friend
Matt
__________________
Wind is your friend
Matt
 
Old September 14th, 2004, 11:06 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

The brunt of it is it simply isn't style-able. But there are hacks.

Have a read of the last posts to this thread:
http://p2p.wrox.com/topic.asp?TOPIC_ID=4772

HTH!

Regards,
Rich

--
[http://www.smilingsouls.net]
[http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
 
Old September 15th, 2004, 12:30 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Richard

Sorry, I should have searched the forum before posting.
Imar the great - "what he doesnt know surely isn't worth knowing"

Thanking you muchly

Wind is your friend
Matt
 
Old September 15th, 2004, 01:18 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Matt,

Make sure you read the entire thread. The solution I proposed initially doesn't work (anymore??). However, the one offered by Rich does seem to work:

http://www.quirksmode.org/dom/inputfile.html

Haven't tested it really, but it looks cool.....

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old September 15th, 2004, 02:00 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Good day Imar

Thank you kindly. This is a real treat, I have been looking on and off for a solution to this for a long time now. That stock standard button style is a real eye sore.

I was also looking for a way to insert a &nbsp; (actually any kind of space) between the button and the input area containing the file path.

TY again

Wind is your friend
Matt
 
Old September 16th, 2004, 04:59 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Be careful with that solution. I forgot to mention Peter's page (quirksmode) crashes Mozilla 1.8 alpha 3. I'm not sure if that has something to do with his Javascript, but I think that's what it is. Of course the problem could end up being fixed in 1.8 beta or stable. Just FYI.

Regards,
Rich

--
[http://www.smilingsouls.net]
[http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
 
Old September 17th, 2004, 02:14 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Interesting, thanks to Rich and Imar for your time. Seems like allot of code, research and effort to achieve a 'very' small visual change. However a change I think is neccessary for some of my pages visual-ness.

This is the first tag I have come accross that is conventionaly in styleable - Do any others come to mind??

Wind is your friend
Matt
 
Old September 19th, 2004, 02:50 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Before coming across that hack I didn't think it was possible to style at all.

I'm not aware of anything else, but then the file upload control is rather unique, since it really combines two controls in one. I know that form controls aren't style-able at all in the Safari browser.

Regards,
Rich

--
[http://www.smilingsouls.net]
[http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail





Similar Threads
Thread Thread Starter Forum Replies Last Post
input type="file" grstad Classic ASP Basics 24 January 31st, 2007 07:28 PM
how can i restore <input type="hidden"> 's value ? yamunchien ASP.NET 1.0 and 1.1 Basics 4 March 18th, 2006 08:45 PM
input type file darkhalf Javascript 1 October 29th, 2005 02:17 AM
<input type="File"> - Specify File Type and Path gp_mk Classic ASP Basics 2 August 2nd, 2004 03:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.