Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

IFRAME deactivate

Posted on 2004-08-05
8
Medium Priority
?
516 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
  • 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

Independent Software Vendors: 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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

885 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