Re: new form control

Kornel Lesinski wrote:
> I think it doesn't even need another element — nothing stops UAs
from displaying:
>
> <input type=file accept="image/*" style="width:300px; height:300px" />

Styling file input control like that is probably problematic,
but in the broader sense I agree - UAs could easily already implement
simple preview right next to file input control if an image is
selected.

> <input type=file id=uploader>
> ...
> <div dropped-files=uploader>drop here!</div>

But these special drag-and-drop areas seem strange. When talking
about WYSIWYG editors, then scripting support for dragging and dropping
would be more appropriate for implementing this functionality
than adding new elements and/or attributes to HTML. Clearly
not every user would implement a WYSIWYG editor on his website.

On the other hand - nothing stops UAs from adding drag-drop
support to file input control. Submitting the form should be
separate from that - if the page author decides that immediate
submit is needed, this can be easily added by small script like
<input type="file" onchange="form.submit();">

I don't really understand the need for builtin asyncronous
submits. I think it's better left to the world of AJAX and similar. As
much as I know, there is currently no reliable way to upload
file with AJAX (I've read of some tricks to make it happen in
IE [1] and Mozilla [2]) - so maybe instead intoducing some new
functionality to the DOM would be neccessary. But there are some
security-problems with it.

[1] http://www.codeproject.com/useritems/AJAXUpload.asp
[2] http://www.captain.at/ajax-file-upload.php

--
Rene Saarsoo

Received on Tuesday, 24 April 2007 13:50:09 UTC