IE + Iframe popup problem


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: IE + Iframe popup problem

  1. #1
    Join Date
    Apr 2007
    Posts
    1

    IE + Iframe popup problem

    Hello Everyone,

    I was stuck with this really frustrating problem for sometime. Let me
    explain what I am trying to achieve: There is a form and an inner
    iframe. The form's target is set to the iframe so that when the form
    is submitted, the page does not get reloaded/changed ( as the iframe
    would be the one getting refreshed. The Iframe is set to have 0 width
    and height to make it look invisible ).

    The html source ( bug.txt ( html file ) IE + Iframe popup problem) to demonstrate this.
    There are 2 form/iframe pair
    a) Static form / iframe
    b) Javascript generated form / iframe.
    and both forms are submitted using javascript.

    In firefox, both a) and b) works perfectly ( i.e there are no
    popups / page reloads/ page change )
    In IE, a) works fine BUT b) does not ( a popup is created when the
    form is submitted )

    I am failing to understand why b) is not working in IE ( i.e why
    the popup is appearing ).
    Could someone help me on this one ?

    Thanks
    Attached Files Attached Files

  2. #2
    Join Date
    Apr 2007
    Posts
    6
    The problem is when you use document.createElement(...), IE dose not set the name attribute for the created element, even if you use:
    elm.setAttribute('name', 'somename');
    or
    elm.name = 'somename';
    so, you can use the following fashion:
    var newDiv = document.createElement('div');
    newDiv.innerHTML += '<iframe name="form_'+uniqueId+'_iframe" ... />';

Similar Threads

  1. Replies: 3
    Last Post: 11-16-2005, 07:15 PM
  2. Replies: 0
    Last Post: 10-25-2005, 07:49 AM
  3. Reliability Problem
    By elise in forum Java
    Replies: 0
    Last Post: 10-30-2002, 05:40 AM
  4. To Devin Knutson (redirect problem)
    By Daniel in forum ASP.NET
    Replies: 0
    Last Post: 07-04-2001, 10:49 AM
  5. Replies: 0
    Last Post: 06-23-2000, 03:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center