Reply to Re: How to apply a class to input type=file

Your name:

Reply:


Posted by Jukka K. Korpela on 04/02/07 14:58

Scripsit Mike Minor:

> I'm using CSS to modify the appearance submit buttons on various
> pages.

That's generally counter-productive, since you increase the odds that they
won't be recognized as submit buttons. You also tend to get crappy results
e.g. on Windows XP, which has rather nice default appearance for submit
buttons but easily turns to a crude rectangle when you start "styling" it.

So my primary advice on the problem is that you should stop creating it.

> On one page I have an <input type="file"> line which
> automatically includes a BROWSE button.

That's strange enough to many users, even without any further obfuscation.
Many people don't understand what file submission is. They _might_ know that
if they see a _familiar-looking_ file input widget. It seems that you are
aiming at preventing that.

> I add the class="button" to the input type="file" line.

Well, OK, that doesn't do anything, as such.

> However, it doesn't apply the button's
> appearance doesn't change.

Did you expect it to change? Why?

> Instead it applys the appearance changes
> to the text input box.

I suspect you have some style sheet, and I pretty much know that you have
errors in it.

When you searched for an answer in the group archives before posting, did
you _really_ miss all those helpful "please specify the URL" or "tell us the
URL unless you want just waste everyone's time" notes?

> Sorry, but the site is not up on the web yet, so I can't post a link
> for you to see it yet.`

That's a _lame_ excuse. You can always upload a demo page.

> What I have tried is the following:
>
> <input type=file size=77 name="FILE1" class="button">

Well, that much was obvious from previous, except for irrelevant details
like the name and size attribute values. Just the rest remains hidden.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация