473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

how to make it modal ?

var docCal

function hello()
{
winCal=
window.open("",null,"toolbar=0,status=0,menubar=0, fullscreen=no,width=195,he
ight=245,resizable=0,top="+cnTop+",left="+cnLeft);
docCal = winCal.document;
RenderCal();
}

function RenderCal()
{

//here i dynamically load the documnet
docCal.open()
docCal.writeln("<html><head><title>"+WindowTitle+" </title>");
docCal.writeln("<script>var 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 9926
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/xdmthShowModalDialog_HV01021416.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/xdmthShowModalDialog_HV01021416.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,menubar=0, fullscreen=no,width=195,he
ight=245,resizable=0,top="+cnTop+",left="+cnLeft);


- 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,status,scrollbars,modal,width=195,heigh t=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:'<html><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("about:blank",null,"modal");
newWin.document.open();
newWin.document.write("<body>Some 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
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...
2
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...
10
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...
2
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...
4
by: Paul Aspinall | last post by:
Can anyone advise how to display a form on top, and modal, without using ShowDialog?? Thanks
6
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....
10
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...
4
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...
20
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.