?
Solved

Simulating a ModalDialog window in VBScript

Posted on 1998-10-13
4
Medium Priority
?
1,677 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
[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
  • 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

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Suggested Courses

771 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