input type=file

For topics about current BETA or future releases, including feature requests.

input type=file

Postby RSteinwand » Tue Mar 02, 2010 11:42 am

Hi Albert.

I have a file upload page that I'd like to increase the width. Setting the width with css doesn't seem to work, but when I used this (which does work) I get a warning:

<input type="file" name="filename" id="filename" onkeydown="return false" size="50" />

"The "size" attribute does not apply when type="file". Consider removing this attribute."

I can't find anything online that would indicate this isn't valid for xhtml strict. http://w3schools.com/tags/tag_input.asp
Rick
User avatar
RSteinwand
Rank IV - Intermediate
Rank IV - Intermediate
 
Posts: 199
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND

Re: input type=file

Postby Albert Wiersch » Tue Mar 02, 2010 5:28 pm

Hello,

According to HTML5, it is not a permitted attribute for type="file":
http://dev.w3.org/html5/markup/spec.html#input.file

The permitted attributes for "input" when type="file" are:
common attributes & name & disabled & form & type★ & accept & autofocus & required & multiple

But I see that it does seem to work in IE and Firefox so I will remove that message. Thanks!
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2435
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: input type=file

Postby RSteinwand » Tue Mar 02, 2010 5:35 pm

I didn't think to check html5 specs.

Couldn't you just label it as invalid for html5? I think you already have similar warnings.

That type="file" is a bugger, you can't style it w/o a script and the default width doesn't show much.
Rick
User avatar
RSteinwand
Rank IV - Intermediate
Rank IV - Intermediate
 
Posts: 199
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND

Re: input type=file

Postby MikeGale » Tue Mar 02, 2010 5:46 pm

On a matter of principle.

If a browser accepts some markup that trumps a written specification, in my book.

I want something that works in the real world. (I have a low opinion of parts of some specifications which simply look nutty to me. Implementers often seem to agree and just do what they believe is right, so I'm not alone!)

I know it's harder work for Albert, but messages which reflect the real world are valuable to me.
User avatar
MikeGale
Rank VI - Professional
Rank VI - Professional
 
Posts: 612
Joined: Mon Dec 13, 2004 2:50 pm
Location: Tannhauser Gate

Re: input type=file

Postby Albert Wiersch » Tue Mar 02, 2010 5:51 pm

RSteinwand wrote:Couldn't you just label it as invalid for html5? I think you already have similar warnings.


I suppose I could, but I don't really see the point in terms of usefulness. If it works, then I'll just leave it as is without generating another message that probably won't be useful. However, if I find out that "size" doesn't work in a particular browser then I could generate a message about that.

CSE HTML Validator has always been more about "what works in the real world" than adhering strictly to the specs. :D
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2435
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: input type=file

Postby Lou » Tue Mar 02, 2010 6:29 pm

MikeGale wrote:On a matter of principle.

If a browser accepts some markup that trumps a written specification, in my book.

I want something that works in the real world. (I have a low opinion of parts of some specifications which simply look nutty to me. Implementers often seem to agree and just do what they believe is right, so I'm not alone!)

I know it's harder work for Albert, but messages which reflect the real world are valuable to me.

On a matter of principle -- WHAT?:????

Which is why there are so may patches/fixes/hacks to make the standard work in different browsers, because they "just do what they believe is right"

At least the standards are documented. JMHO
Lou
Say what you will about Sisyphus. He always has work.
User avatar
Lou
Rank IV - Intermediate
Rank IV - Intermediate
 
Posts: 190
Joined: Fri Jul 29, 2005 5:55 pm
Location: MD


Return to CSE BETA Talk

Who is online

Users browsing this forum: No registered users and 2 guests