Re: No error about missing enctype="multipart/form-data" with input type="file"

Jukka K. Korpela wrote:
> On Tue, 19 Oct 2004, Jan Willem Knopper wrote:
Thank you for your fast reply,
> 
> > In a form I used an input type="file" (inside a table). The form lacked
> > the enctype="multipart/form-data".
> 
> It is somewhat debatable whether that's against the specifications.
> In practical terms, you should surely use that enctype for a form that
> contains a file input field.
> 
> But it surely doesn't violate any _formalized_ requirement in the HTML
> specification.
> 
As I read it back it says for the enctype attribute:
	The value "multipart/form-data" should be used in combination
	with the INPUT element, type="file".

I read this the first time as if you use INPUT type=file, then..., but I
see that this is debatable and I agree that there is no formalized
requirement.

> > I got no errormessage from the validator.
> 
> That's unavoidable, since the mistake is not a reportable markup error.
> Your markup does not violate the formal rules in the DTD, which is all
> that the validator knows, basically.
> 
> It even _could not_ be a reportable markup error. In SGML (and still less
> in XML) you cannot express, in a DTD, a requirement that an attribute must
> be present if a certain other attribute is present - still less that an
> attribute with a specific value must be present depending on the value of
> another attribute. If an attribute is made REQUIRED, then it is
> unconditionally required.
> 
So it seems it is not an error and cannot be reported. 

Maybe there should be a message in the 4.01 specification about using
enctype at the file-select control type (17.2.1), but I guess thats
another mailing list.

Thanks for your quick response,

Jan Willem Knopper

Received on Tuesday, 19 October 2004 12:45:04 UTC