How to apply a class to input type=file

M

Mike Minor

I'm using CSS to modify the appearance submit buttons on various pages. On
one page I have an <input type="file"> line which automatically includes a
BROWSE button. I add the class="button" to the input type="file" line.
However, it doesn't apply the button's appearance doesn't change. Instead it
applys the appearance changes to the text input box. How do I get it to
apply the appearnce change to the button and not the text box?

Sorry, but the site is not up on the web yet, so I can't post a link for you
to see it yet. What I have tried is the following:

<input type=file size=77 name="FILE1" class="button">

Mike Minor
 
J

Jukka K. Korpela

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

Mike Minor

Sorry I'm so STUPID!

I thought news groups were for asking questions...with responses like these
it's a wonder any body bothers.

And by the way, I have been studying Yukka's web site to try and pick up
some tips. It's a nice and helpful site. Too bad his attitude comes across
so negatively when he responds to questions here. He doesn't have any
insight into what my superiors have asked me to do and what I'm trying to
accomplish. He just puts it down to my supidity.

Now that I think of it, he reminds me of a professor I had my freshman year
of college. His VERY FIRST statment he made to our class was, "I don't
answer questions." My first thought was, "then what the hell good are you as
a teacher."

In my humble opinion, if he can't say something helpful, he should just not
respond. I am so sick and tired of the holy-er than thou attitudes I see so
often here.......


Mike
 
B

Blinky the Shark

Bergamot said:
I don't know if you are stupid or not, but you *have* failed to follow
the posting conventions of this group. Top posting will get you flamed
quicker than asking "stupid" questions will.

Sure, but *real* competitors go for the Daily Double and do both.

For the Trifecta, they can add posting with an invalid sig delimiter.
 
B

Bergamot

Mike said:
Sorry I'm so STUPID!

I don't know if you are stupid or not, but you *have* failed to follow
the posting conventions of this group. Top posting will get you flamed
quicker than asking "stupid" questions will.
http://allmyfaqs.net/faq.pl?How_to_post
I thought news groups were for asking questions

Generally, they are discussion groups. If you pose a question various
aspects are likely to be discussed and you may or may not get the answer
you originally sought. That's the way Usenet is.
And by the way, I have been studying Yukka's web site to try and pick up
some tips. It's a nice and helpful site.

I wish I knew half of what he knows.
Too bad his attitude comes across
so negatively when he responds to questions here.

I don't necessarily agree with his methods, but I do understand his
annoyance to a degree. The same questions come up repeatedly around
here. If you search the google archives, you'd probably find the answer
yourself, a lot faster and with a lot less flak, too.
http://groups.google.com/advanced_search

Learn to help yourself and you'll probably get more respect from others
in the group.
He doesn't have any
insight into what my superiors have asked me to do and what I'm trying to
accomplish.

That's where the "discussion" part of this group comes in. Questioning
whether something ought to be done in the first place is fairly common
around here. If you had spent any time looking at recent posts before
you jumped in, you might have noticed this pattern (or read about it in
another post) and prepared yourself for it.
In my humble opinion, if he can't say something helpful, he should just not
respond.

Welcome to Usenet. People post what they want, when they want. If you
don't like it, maybe you'll be happier in a moderated forum somewhere
else. I can't speak for the quality of information you'll get elsewhere,
of course.
I am so sick and tired of the holy-er than thou attitudes I see so
often here.......

Frankly, I get tired of newbies not bothering to learn the rules of the
group in which they post, then getting upset when they don't like the
responses they get.

But that's me. ;)
 
A

al jones

Sorry I'm so STUPID!

I thought news groups were for asking questions...with responses like these
it's a wonder any body bothers.

And by the way, I have been studying Yukka's web site to try and pick up
some tips. It's a nice and helpful site. Too bad his attitude comes across
so negatively when he responds to questions here. He doesn't have any
insight into what my superiors have asked me to do and what I'm trying to
accomplish. He just puts it down to my supidity.

Now that I think of it, he reminds me of a professor I had my freshman year
of college. His VERY FIRST statment he made to our class was, "I don't
answer questions." My first thought was, "then what the hell good are you as
a teacher."

In my humble opinion, if he can't say something helpful, he should just not
respond. I am so sick and tired of the holy-er than thou attitudes I see so
often here.......

Mike

Mike,
For what it's worth Jukka's probably one of the more helpful people here -
just not the most diplomatic. You asked a question - and rather than
getting the answer you wanted, you were told that it probably wasn't the
best thing to try to do - with reasons (and, hey, you DID get reasons!)

I won't re-iterate the others comments about following convention, you
didn't and got the flack for it. Different groups, different conventions
just like 'real life'.

I will say that you first comment is *DEAD WRONG* (I thought news groups
were for asking questions...) news groups - at least most of the technical
news groups *I* inhabit - are for discussion. One *can* get help but these
are *NOT* your own private help desk. I've asked come really dumb
questions and gotten some really helpful information - and sometimes the
two even seemed to be related ... that said, take a chill pill, take a
look at what you're trying to do and see if maybe Jukkas response wasn't
what you needed.

On the topic of superiors asking you to do something - if it's
counterproductive are you really going to stand back and let them pressure
you into doing it (I know, it's a paycheck) when it would be in their
better interests to try to educate them as to *why* this isn't the best
idea....
 
M

Mike Minor

al jones said:
Mike,
For what it's worth Jukka's probably one of the more helpful people here -
just not the most diplomatic. You asked a question - and rather than
getting the answer you wanted, you were told that it probably wasn't the
best thing to try to do - with reasons (and, hey, you DID get reasons!)

I won't re-iterate the others comments about following convention, you
didn't and got the flack for it. Different groups, different conventions
just like 'real life'.

I will say that you first comment is *DEAD WRONG* (I thought news groups
were for asking questions...) news groups - at least most of the technical
news groups *I* inhabit - are for discussion. One *can* get help but
these
are *NOT* your own private help desk. I've asked come really dumb
questions and gotten some really helpful information - and sometimes the
two even seemed to be related ... that said, take a chill pill, take a
look at what you're trying to do and see if maybe Jukkas response wasn't
what you needed.

On the topic of superiors asking you to do something - if it's
counterproductive are you really going to stand back and let them pressure
you into doing it (I know, it's a paycheck) when it would be in their
better interests to try to educate them as to *why* this isn't the best
idea....
I won't re-iterate the others comments about following convention, you
didn't and got the flack for it. Different groups, different conventions
just like 'real life'.

OK where are the "conventions" posted for this newsgroup so ol' stupid here
doesn't offend someone in the future....

"Stupid" Mike
 
B

Bergamot

Mike said:
OK where are the "conventions" posted for this newsgroup

It hasn't been updated for a while, but the Usenet etiquette section
should still be correct. That stuff doesn't really change.
http://www.html-faq.com/
so ol' stupid here
doesn't offend someone in the future....

Ignorance and stupidity are not the same thing. Ignorance can be
corrected. If you show you aren't willing to learn or adapt, then you
show you are less ignorant and more stupid. ;)

Just don't take things so personally. Personal attacks are actually
pretty rare around here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top