[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Simulating a ModalDialog window in VBScript

Posted on 1998-10-13
4
Medium Priority
?
1,727 Views
Last Modified: 2013-12-25
Is there anyway I can simulate a Modal Dialog window in VBScript with a window.open?  I don't want to use the
window.showModalDialog command because there are features in the standard window that I need that is not supported by the showModalDialog window.

Basically I want my window to simulate the action that the window does not lose focus until it is closed.

Any ideas?
0
Comment
Question by:Mira060397
  • 3
4 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 200 total points
ID: 1855667
try JavaScript:
<SCRIPT LANGUAGE="JavaScript">
modalres = '';
WinId = window.open('mymodal.htm','newwin','width=300,height=100');
if (!WinId.opener) WinId.opener = self;
</SCRIPT>

and in the mymodal.htm have
<BODY onBlur="if (window.focus) self.focus()">
<H3>Click one</H3>
<FORM>
<INPUT TYPE="BUTTON" VALUE="OK" onClick="opener.modalres='ok';self.close()">
<INPUT TYPE="BUTTON" VALUE="CANCEL" onClick="opener.modalres='cancel';self.close()">
</FORM>

0
 

Author Comment

by:Mira060397
ID: 1855668
Okay I tried that, but the only problem is that I can't click or
select anything in the myModal.htm.  It seems that it keeps giving the focus to the <BODY> and anytime I click some element with in the <BODY> it causes the <BODY> to lose focus, so it resets the focus, etc.  I'm testing this in IE4, so I don't know if this is suppose to work in Netscape.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1855669
What do you have in the body?
Any input fields or buttons in the mymodal.htm should be inside the <BODY></BODY> tags so if the body has focus the user shoudl be able to interact. I will have a look in IE4.

In the meantime, you can shift the focussing to the body tag in the opening page instead <BODY onFocus="if (WinId && window.focus) WinId.focus()">

Michel
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1855670
You are correct! What a crock!

It works in NS 3 and 4 so we need to find a workaround somehow...

I will investigate tomorrow

Michel
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses
Course of the Month19 days, 10 hours left to enroll

872 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