Results 1 to 2 of 2

Thread: Moving file input to different form doesn't work in IE7

  1. #1
    Join Date
    Mar 2010
    Posts
    1

    Moving file input to different form doesn't work in IE7

    Hi!
    I have form inside iframe. I want to copy form to parent window after user entered data and then submit.
    Everything works fine, except with file input.
    It seems impossible to move file input(after user selected file) to different form in different document (only ie7).
    Here is javascript code im using inside iframe to move form elements:
    Code:
    var parentForm = parent.document.getElementById('editGallerieFormParent');
    parentForm.ordering.value = form.ordering.value;
    parentForm.catname1.value = form.catname1.value;
    parentForm.description.value = form.description.value;
    var copy;
    if( !!document.all ) { //ie
    /* ie8 fix	*/				
    // clone up a new one
    var oldFile = form.i_file;
    var newFile = form.i_file.cloneNode(true);
    
    // set props
    newFile.id = "i_file";
    newFile.name = "i_file"; 
    
    // replace old with new
    oldFile.parentNode.replaceChild(newFile, oldFile);
    				
    // attach old to upload form						
    parentForm.appendChild(oldFile);																			
    } else { //firefox
      copy = form.i_file.cloneNode(1);					 
      parentForm.appendChild(copy);
    }
    														
    					
    					
    parentForm.konkurss_end_date.value = form.konkurss_end_date.value;
    parentForm.submit();
    on ie7 i recieve error "Invalid argument" at parentForm.appendChild(oldFile);

    How to fix this?

  2. #2
    raul21 is offline New Member: Posts Will Be Moderated
    Join Date
    Jan 2011
    Posts
    1
    Hello, I am having exactly the same problem. Did you manage to fix it?

    Thanks

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •