Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hidden Iframe not working in IE

    Hi Coders,

    Cpuold somebody help me on following case, what im trying to do here is create a dynamic hidden iframe and write a form into it and submit. this approach works in FireFox but not in IE7, below is the code im using

    document.forms[form].appendChild(isProcessFQ);
    var ifText = document.getElementById(rootElID).innerHTML;
    var ifSubmit = document.createElement('iframe');
    var ifSubmitID = 'inf-fq-process-' + sessionID;
    ifSubmit.setAttribute('id',ifSubmitID);
    ifSubmit.setAttribute('name',ifSubmitID);
    ifSubmit.setAttribute('style','display: none');
    document.getElementById(rootElID).appendChild(ifSubmit);
    if(ifSubmit.contentDocument) {
    doc = ifSubmit.contentDocument;
    }else
    if(ifSubmit.contentWindow) {
    doc = ifSubmit.contentWindow;
    }else
    if (ifSubmit.document) {
    doc = ifSubmit.document;
    }
    doc.open();
    doc.write(ifText);
    doc.close();
    doc.forms[0].submit();

    But when i run this in IE7 its openings a new blank window after the statement doc.open(); and shows some error(which has no useful details) and not maing any calls to server.

    could somebody tell me how to fix this behaviour please.

    Thank you,
    bala.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    Just a guess ...

    if(ifSubmit.contentWindow) {
    doc = ifSubmit.contentWindow.document;

  • #3
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    Thx for the reply. now the form is getting submitted. but hidden parameters that i have under the form (the ones i created dynamically) are not available on server side. i mean if try to access these parameters on the server side im getting null? as you see i added the same form that i have in the result page to the hidden iframe, if i submit the main form even with dynamic parameters i can access those on server side. this happens only in IE7, FF works fine. any help would be appriceated.

    Thank you,
    bala.

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    Too many unidentified variables there to really see what's happening. This is interesting:

    var ifText = document.getElementById(rootElID).innerHTML;

    Could you post that html string so we can see what's going into the iframe doc?


  •  

    Posting Permissions

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