IE6 Form and Its Properties After Submit

V

vunet

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/library/ms533745(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.
 
D

dhtml

vunet said:
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/library/ms533745(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
 
V

vunet

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;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top