From c269b4958746db8e4f035536112e871387e3040d Mon Sep 17 00:00:00 2001 From: alecpl Date: Fri, 19 Aug 2011 12:53:39 +0000 Subject: - Improve setting upload form attributes, IE7 uses 'encoding' attribute instead of 'enctype' --- program/js/app.js | 11 ++++++----- 1 file 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; }; -- cgit v1.2.3