Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

IFRAME deactivate

Posted on 2004-08-05
8
Medium Priority
?
515 Views
Last Modified: 2008-02-01
hi expertz,

i am using a form, in which i use IFRAME to show up dialogs instead of WINDOW.OPEN or SHOWMODALDIALOG.

my problem is when IFRAME is active, and we click outside the IFRAME, the IFRAME disappears, is it possible to SHOW the IFRAME till a CANCEL button in the IFRAME is clicked ?

thanks
-ravig
0
Comment
Question by:rkg_eagle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
8 Comments
 
LVL 8

Expert Comment

by:RozanaZ
ID: 11726070
Hi,
Can you post your code, please? Or just an example?
0
 

Author Comment

by:rkg_eagle
ID: 11726369
hi rozanaz,

-- main.html
<html>
<script language=javascript>
function OpenDlg()
{
            document.frames("DialMatrix").document.body.innerHTML = "Loading...";
                         document.frames("DialMatrix").style.display='block';
            document.frames("DialMatrix").src = "test.htm";
}
</script>

<input type=button value=Activate onclick=OpenDlg()>

<iframe id="DM" name="DM" onfocusout="Focusout()" style="display:none;position:absolute;width:600;height:400;z-index:3;border=1 black solid;"></iframe>
</html>

-- test.html
<html>
<script language=javascript>
function Close()
{
      frameElement.style.display = 'none';
}
</script>
<input type=button value=Close onclick=Close()>
</html>

i ll display the main.html first, onclick of button this frame is shown. the IFRAME should close only on clicking the CLOSE button in test.html. it should not close even if the user clicks on the visible portions of main.html

thanks
-ravig
0
 

Author Comment

by:rkg_eagle
ID: 11726386
hi rozanaz,

-- main.html
<html>
<script language=javascript>
function OpenDlg()
{
          document.frames("DM").document.body.innerHTML = "Loading...";
          document.frames("DM").style.display='block';
          document.frames("DM").src = "test.htm";
}
</script>

<input type=button value=Activate onclick=OpenDlg()>

<iframe id="DM" name="DM" onfocusout="Focusout()" style="display:none;position:absolute;width:600;height:400;z-index:3;border=1 black solid;"></iframe>
</html>

-- test.html
<html>
<script language=javascript>
function Close()
{
     frameElement.style.display = 'none';
}
</script>
<input type=button value=Close onclick=Close()>
</html>

i ll display the main.html first, onclick of button this frame is shown. the IFRAME should close only on clicking the CLOSE button in test.html. it should not close even if the user clicks on the visible portions of main.html

thanks
-ravig
0
 
LVL 8

Accepted Solution

by:
RozanaZ earned 100 total points
ID: 11726554

Hi  rkg_eagle,

Try to remove:

 onfocusout="Focusout()"

from

<iframe id="DM" name="DM" onfocusout="Focusout()" style="display:none;position:absolute;width:600;height:400;z-index:3;border=1 black solid;"></iframe>
0
 
LVL 7

Assisted Solution

by:zac_charles
zac_charles earned 100 total points
ID: 11741438
this works fine, i changed your javascript around a little bit, the result is the same (apart from this way works ;) and it also will work in all browsers now.

All you have to change is main.html

<html>

<head>
  <script language=javascript>
    function OpenDlg()
    {
      document.frames['DM'].document.body.innerHTML="Loading...";
      document.getElementById('DM').style.display="block";
      document.frames['DM'].location.href="test.html";
    }
  </script>
</head>

<body>
  <input type=button value=Activate onclick=OpenDlg()>
  <iframe name="DM" id="DM" style="display:none;position:absolute;width:600;height:400;z-index:3;border=1 black solid;"></iframe>
</body>

</html>
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question