By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,831 Members | 1,031 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,831 IT Pros & Developers. It's quick & easy.

IE6 Form and Its Properties After Submit

P: n/a
Hello,

My HTML form submits some values to a hidden iframe. However, this is
done for file upload fields only. After file uploading is finished I
am using this form to submit all other data (inputs, textareas, etc.)
normally.
The file upload mechanism is structured in the way that it sets form's
enctype (multipart) and target to iframe dynamically and then resets
to old values right after submit() method.
This works ideally in most (maybe almost all) browsers but IE6.
I learned that for IE6 it is not enctype but rather encoding property
that needs to be set:

http://msdn.microsoft.com/en-us/libr...45(VS.85).aspx (see
Warning on the bottom)

Fine, but when I set encoding, submit() the form, then I am unable to
reset the form's properties such as encoding or target in IE6, because
as I briefly heard IE6 loses its reference to the form after using
submit().
I am not sure how true this is because my alerts did show encoding and
target properties in IE6 which, unfortunately, could not be reset.

On another hand, I saw that some time pauses need to be applied to
reset values after submit in IE6 but I am still looking into that.

I need a solution for this or explanation of why it is happening. If
anyone is aware of anything to help me move forward please suggest.
Thanks.
Oct 7 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
vunet wrote:
Hello,

My HTML form submits some values to a hidden iframe. However, this is
done for file upload fields only. After file uploading is finished I
am using this form to submit all other data (inputs, textareas, etc.)
normally.
The file upload mechanism is structured in the way that it sets form's
enctype (multipart) and target to iframe dynamically and then resets
to old values right after submit() method.
This works ideally in most (maybe almost all) browsers but IE6.
I learned that for IE6 it is not enctype but rather encoding property
that needs to be set:

http://msdn.microsoft.com/en-us/libr...45(VS.85).aspx (see
Warning on the bottom)

Fine, but when I set encoding, submit() the form, then I am unable to
reset the form's properties such as encoding or target in IE6, because
as I briefly heard IE6 loses its reference to the form after using
submit().
I am not sure how true this is because my alerts did show encoding and
target properties in IE6 which, unfortunately, could not be reset.

On another hand, I saw that some time pauses need to be applied to
reset values after submit in IE6 but I am still looking into that.

I need a solution for this or explanation of why it is happening. If
anyone is aware of anything to help me move forward please suggest.
Thanks.
I can't personally test your code in IE6 but if you post your code here,
in a simple, reduced example, neatly wrapped at about 72 characters,
you'll be more likely to get help.

Garrett
Oct 8 '08 #2

P: n/a
On Oct 8, 1:38*am, dhtml <dhtmlkitc...@gmail.comwrote:
vunet wrote:
Hello,
My HTML form submits some values to a hidden iframe. However, this is
done for file upload fields only. After file uploading is finished I
am using this form to submit all other data (inputs, textareas, etc.)
normally.
The file upload mechanism is structured in the way that it sets form's
enctype (multipart) and target to iframe dynamically and then resets
to old values right after submit() method.
This works ideally in most (maybe almost all) browsers but IE6.
I learned that for IE6 it is not enctype but rather encoding property
that needs to be set:
http://msdn.microsoft.com/en-us/libr...S.85).aspx(see
Warning on the bottom)
Fine, but when I set encoding, submit() the form, then I am unable to
reset the form's properties such as encoding or target in IE6, because
as I briefly heard IE6 loses its reference to the form after using
submit().
I am not sure how true this is because my alerts did show encoding and
target properties in IE6 which, unfortunately, could not be reset.
On another hand, I saw that some time pauses need to be applied to
reset values after submit in IE6 but I am still looking into that.
I need a solution for this or explanation of why it is happening. If
anyone is aware of anything to help me move forward please suggest.
Thanks.

I can't personally test your code in IE6 but if you post your code here,
in a simple, reduced example, neatly wrapped at about 72 characters,
you'll be more likely to get help.

Garrett
The code is below and imagine there is a hidden Iframe with
name="IFRAME_UPLOAD_TARGET":

VAR IE6 = !!(window.attachEvent && !window.opera && !
window.XMLHttpRequest)
var rememberAction = (form.action) ? form.action : "";
var rememberTarget = (form.target) ? form.target : null;
var rememberEnctype = (form.enctype)? form.enctype : null;
form.action = "page_to_upload_images/"
form.target = "IFRAME_UPLOAD_TARGET";//THIS IS HIDDEN IFRAME
if(ie6)form.enctype = "multipart/form-data";
else form.encoding = "multipart/form-data";
form.submit();
form.action = rememberAction;//change back
form.target = rememberTarget;
form.enctype = rememberEnctype;
Oct 8 '08 #3

P: n/a
On 2008-10-08 19:57, vunet wrote:
VAR IE6 = !!(window.attachEvent && !window.opera && !
window.XMLHttpRequest)
if(ie6)form.enctype = "multipart/form-data";
else form.encoding = "multipart/form-data";
"IE6" and "ie6"? Maybe that's just a typo, but you should be aware that
identifiers are case sensitive.
- Conrad
Oct 8 '08 #4

P: n/a
On Oct 8, 2:41*pm, Conrad Lender <crlen...@yahoo.comwrote:
On 2008-10-08 19:57, vunet wrote:
VAR IE6 = !!(window.attachEvent && !window.opera && !
window.XMLHttpRequest)
if(ie6)form.enctype = "multipart/form-data";
* *else form.encoding = "multipart/form-data";

"IE6" and "ie6"? Maybe that's just a typo, but you should be aware that
identifiers are case sensitive.

* - Conrad
that's just a typo.
Oct 9 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.