#8186 closed bug (duplicate)
Setting enctype attribute in IE8
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | 1.5.1 |
Component: | attributes | Version: | 1.5 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
It can't set the enctype attribute in IE8:
f=$("<form>"); f.attr("enctype","multipart/form-data");//it doesn't work in IE8, form doesn't send a content of an upload file f.attr("id","idx");//it works right f.append('<input type="file" name="..." />'); ...
It works in FF, but not in IE8. Only "enctype" attribute can't set with attr() method in IE8.
Code for IE8:
f=$("<form enctype="multipart/form-data"/>"); f.attr("id","idx"); ...
Change History (3)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Component: | unfiled → attributes |
---|---|
Milestone: | 1.next → 1.5.1 |
Priority: | undecided → low |
Resolution: | → duplicate |
Status: | new → closed |
Thanks for taking the time to contribute to the jQuery project by writing a bug report.
This is a known problem. You should be able to workaround this by doing
var f=$("<form>"); //note the camelcased attribute name works for most browsers including IE8 f.attr("encType", "multipart/form-data"); //needed for browsers where setting enctype isn't enough e.g. IE6/7 f.attr("encoding", "multipart/form-data");
Eventually this will be fixed in jQuery directly and the workaround no longer needed. You can check the ticket mentioned below for progress on this issue.
Note: See
TracTickets for help on using
tickets.
Example that bug: