summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-08-19 12:53:39 +0000
committeralecpl <alec@alec.pl>2011-08-19 12:53:39 +0000
commitc269b4958746db8e4f035536112e871387e3040d (patch)
tree44779297850b70a6dfa545c46c68b1a988034901
parent9e443d1529df66e2961c5237a5fb7db114e7edbb (diff)
- Improve setting upload form attributes, IE7 uses 'encoding' attribute instead of 'enctype'
-rw-r--r--program/js/app.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/program/js/app.js b/program/js/app.js
index d15950d36..6da5a578c 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -5833,11 +5833,12 @@ function rcube_webmail()
// handle upload errors, parsing iframe content in onload
$(frame_name).bind('load', {ts:ts}, onload);
- form.target = frame_name;
- form.action = this.url(action, { _id:this.env.compose_id||'', _uploadid:ts });
- form.setAttribute('method', 'POST');
- form.setAttribute('enctype', 'multipart/form-data');
- form.submit();
+ $(form).attr({
+ target: frame_name,
+ action: this.url(action, { _id:this.env.compose_id||'', _uploadid:ts }),
+ method: 'POST'})
+ .attr(form.encoding ? 'encoding' : 'enctype', 'multipart/form-data')
+ .submit();
return frame_name;
};