473,856 Members | 1,577 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to make it modal ?

var docCal

function hello()
{
winCal=
window.open("", null,"toolbar=0 ,status=0,menub ar=0,fullscreen =no,width=195,h e
ight=245,resiza ble=0,top="+cnT op+",left="+cnL eft);
docCal = winCal.document ;
RenderCal();
}

function RenderCal()
{

//here i dynamically load the documnet
docCal.open()
docCal.writeln( "<html><head><t itle>"+WindowTi tle+"</title>");
docCal.writeln( "<script>va r winMain=window. opener;</script>");
.....

docCal.close();
}
Here in the above java script, where i am creating the HTML page dynamically
... ..
how can i make it modal dialoge ?

Thanks
Ramanand.
Aug 22 '05 #1
6 9953
Ramanand.K wrote:
[...]
Here in the above java script, where i am creating the HTML page dynamically
.. ..
how can i make it modal dialoge ?


Only for IE:

<URL:http://msdn.microsoft. com/library/default.asp?url =/library/en-us/ipsdk/html/xdmthShowModalD ialog_HV0102141 6.asp>


--
Rob
Aug 22 '05 #2
RobG wrote :
Ramanand.K wrote:
[...]
Here in the above java script, where i am creating the HTML page
dynamically
.. ..
how can i make it modal dialoge ?


Only for IE:

<URL:http://msdn.microsoft. com/library/default.asp?url =/library/en-us/ipsdk/html/xdmthShowModalD ialog_HV0102141 6.asp>


and Mozilla:

"modal: (...) The MSIE 6 equivalent to this feature is the
showModalDialog () method."

http://developer.mozilla.org/en/docs...ality_features

Gérard
--
remove blah to email me
Aug 23 '05 #3
Ramanand.K wrote :
var docCal

function hello()
{
winCal=
window.open("", null,"toolbar=0 ,status=0,menub ar=0,fullscreen =no,width=195,h e
ight=245,resiza ble=0,top="+cnT op+",left="+cnL eft);


- You can not force the status bar to be removed.
http://developer.mozilla.org/en/docs..._on_status_bar
- Making the secondary window non-resizable is non-user-friendly and not
advisable. It is in the best interests of the web author and the user to
be able to access content. By making the window non-resizable, you
remove a sane fallback mechanism if, for any reason, the content
overflows requested window dimensions.

Much better is:

winCal = window.open("", null,
"resizable,stat us,scrollbars,m odal,width=195, height=245,top= " + cnTop +
",left=" + cnLeft);

will work as intended in Mozilla 1.x, Seamonkey 1.x and Firefox 1.x

Gérard
--
remove blah to email me
Aug 23 '05 #4
Gérard Talbot wrote:

[...]

and Mozilla:

"modal: (...) The MSIE 6 equivalent to this feature is the
showModalDialog () method."

http://developer.mozilla.org/en/docs...ality_features


Hey, 'modal' works in IE 6 too.
--
Rob
Aug 23 '05 #5
RobG wrote:
Gérard Talbot wrote about "modal" as the 3rd argument to window.open:

"modal: (...) The MSIE 6 equivalent to this feature is the
showModalDialog () method."
http://developer.mozilla.org/en/docs...ality_features
Hey, 'modal' works in IE 6 too.


Thanks for this great tip Rob and Gérard. This is really useful since
Microsoft has crippled the old showModalDialog (specifically, you can't
functionally open it without another hit to the browser, which is
wasteful. By this I mean that you can't open it using
"javascript:'<h tml><head>...'" and have it return anything), and the
only way I could get its functionality, even when I am gerrymandering
IE on my own Win XP Pro, SP 2 system is to use the Win API
showHTMLDialog. See, for example:
http://groups.google.com/group/micro...ee1d91140bc6a/

However, it seems that there is at least a small bug in the IE 6
implementation. It seems like where the margin of the body of the
modal window is, The borders in the example below do not render quite
correctly: there is about a 2 pixel swath that is painted according to
the window that is underneath. Oops.

Csaba Gabor from Vienna

<button onclick="dome() " accesskey=d><u> D</u>o me
<script type='text/javascript'>
function dome() {
var newWin = window.open("ab out:blank",null ,"modal");
newWin.document .open();
newWin.document .write("<body>S ome text</body>");
newWin.document .close();
newWin.document .title = "My favorite title";
}
</script>

Aug 23 '05 #6
RobG wrote:
Gérard Talbot wrote:
"modal: (...) The MSIE 6 equivalent to this feature is the
showModalDialog () method."
http://developer.mozilla.org/en/docs...ality_features


Hey, 'modal' works in IE 6 too.


Hey Rob!

Who says Microsoft doesn't keep up with the times? - Does 'modal'
still work for you with window.open? Cause the example I made about 10
days ago, no longer works for me - though the chrome bug I mentioned is
still there.

Csaba Gabor from Vienna

Sep 4 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
12541
by: amith | last post by:
Hi, I have a javascript, calendar.js which i use to enable my client to select the date. This calendar pops up on the click of a gif image. But the problem is that this poped up window is not modal in nature(i do not want the user to go the parent page unless he selects some date in the calendar popup). In the javascript calendar.js he has used window.open() function to pop up the window. i just want to know whether we have any...
2
6737
by: Gilles T. | last post by:
Hi, How I can refresh a modal dialog in asp.net? I open a modal dialog in first with a dropdownlist. To add a element in my dropdownlist (table), I open a second modal dialog to ask element and save. When I return in my first modal dialog, dropdownlist is not refreshed. I don't know how to refresh my first modal dialog to view my new element in the dropdownlist. Thanks to help me with this problem!
10
4330
by: CyberBless | last post by:
I have a page that opens a child window using window.open(...). How do I make so that when that child window opens you cannot get the focus back on the parent window unless you close the child window? Is it even possible?
2
5506
by: Phill | last post by:
I'd like the startup Windows Form to be Modal. Here's why: I'm working on a website that has links to .NET apps. So when the user clicks on these links they can run the apps locally. Ideally I'd like to have these apps be children of the IE browser that launched them and have them be modal so they have to close one app before launching another.
4
10025
by: Paul Aspinall | last post by:
Can anyone advise how to display a form on top, and modal, without using ShowDialog?? Thanks
6
4910
by: Samuel R. Neff | last post by:
I'm having weird results with a form that is already displayed modally (via ShowDialog) displaying a second form via ShowDialog. The last form is not modal even though it's called with ShowDialog. For example, given three forms: Startup Pop1 Pop2
10
11710
by: Chris Petchey | last post by:
My App is an MDI Parent with MDI Child forms. One of the child forms calls a modal dialog form. I would like the modal dialog form to be INSIDE the mdi parent window. I am not bothered about any of the other things associated with MDI Parent/Child relationships, this is purely an appearance issue. MDIParent property and ShowDialog seem to be mutually exclusive.
4
2226
by: forest demon | last post by:
i've seen previous posts somewhat related to this, so i apologize if this is redundant. I have a main form with separate threads. When showing a dialog like <dialog>.ShowDialog(), it functions as a non-modal instead of modal. any help is appreciated, thanks.
20
2025
by: Prisoner at War | last post by:
Hi, People, Is it possible to have an "empty" or "dummy" <a href***without*** the browser jumping back up the page?? I have a hyperlink that doesn't point to another document, but is used to call forth a modal window onClick (or is there another way, without text or image links, of calling forth JavaScript on user activity??). I would like to spare my visitors the inconvenience and visually jarring effect of getting thrown back up to...
0
9921
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9765
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11065
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10390
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9536
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7098
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5962
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4581
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.