473,705 Members | 2,333 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to make a window modal in nature

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 attribute
which when set to yes will make the window behave modal in
nature.(just like resizable="yes" ,toolbar="yes", do we have
modal="yes" ?)

i checked modal="yes" and it does not make the window behave modal in
nature. Am i using the wrong attribute name?(modal="ye s").

Do we have such attribute. If not what are my other options.

I know that we can use window.showModa lDialog(), but i need to modify
the window.open() function to make the window behave modally. Is it
possible to do so?

regards
Amith
Jul 20 '05 #1
1 12526
"amith" <it*******@yaho o.co.in> wrote in message
news:90******** *************** **@posting.goog le.com...
<snip>
This calendar pops up on the click of a gif image.
Sometimes.
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).
Even if the window was modal (including showModalDialog windows) it
would (and should) still be possible for the user to close it and return
to the parent without making a selection.
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 attribute which when set to yes will make the
window behave modal in nature.(just like resizable="yes" ,
toolbar="yes ", do we have modal="yes" ?)
No, the new browser instance that is one of the possible results of a
call to the window.open function is a separate process and is not modal
in nature and there are no window features list options that will make
it so. "dependent" (where implemented) comes closest with some browsers
but is so inconsistently implemented that it is probably best just to
leave that alone.
i checked modal="yes" and it does not make the window behave
modal in nature. Am i using the wrong attribute name?(modal="ye s").
You can make up as may feature keys as you like, if they don't appear in
the documentation they are unlikely to do anything but harm.
Do we have such attribute.
No.
If not what are my other options.
1.Attempt to script the new window into a (pseudo) modal window by
monitoring the blur and focus events on all elements in each window so
that re-focusing the original window (or any of its contents) results in
the focus being passed back to the new window. This may sound like a
simple option but in reality is quite tricky to do well and has been
done badly in the past with sufficient frequency that recent browsers
are including user options to prevent scripts from actively focusing
window, so ultimately it can no longer be done reliably anyway. (not
that opening pop-up window can be done reliably anyway).

2.Re-design the process until the perceived need for the window to be
modal goes away (so it will not matter that it cannot reliably be made
so).

3.Navigate the current window to the calendar page, thus making
simultaneous interaction with the first page impossible.

4.Use an "in window pop-up" (DHTML) for the calendar instead of the new
window.
I know that we can use window.showModa lDialog(),
It is an IE only feature so it would be inappropriate to use it on the
internet, at least without writing such a lot of fall-back code for
non-IE browsers that it would be easier to just use the
non-showModalDialog code for all browsers.
but i need to modify the window.open() function to
make the window behave modally. Is it possible to
do so?


If you put enough effort into the blur/focus script and think through,
and test, all of the possibilities then maybe. I would go with the "in
window pop-up" for that type of UI component if I wanted the modal
dialog effect, and navigating the current window if I wanted absolute
reliability.

Richard.
Jul 20 '05 #2

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

Similar topics

2
6519
by: Matt | last post by:
I reposted this question because I really want to accomplish this task. Please advise!! I want to post the form data (http://server/page1.asp) to a modal dialog window (http://server/modaldialog.asp) with a desired height 200px by width 200px. Here's my attempts and problems:
2
3880
by: Matt | last post by:
I want to know how to submit the form data to a modal dialog window? The following is page1.asp, and when the user clicks submit button, it will post the form data to page2.asp by opening a new window. But I want modal dialog window, any ideas?? <form action="page2.asp" method="post" target="_blank"> <input type="text" name="username"> <input type="submit" name="submit"> </form>
1
3370
by: gopal srinivasan | last post by:
I need to know how to close a parent modal window when child modal window opens, also i need to know the syntax for writing document on the modal window on the fly, like what we do in case of normal window. Actually, I tried to close the parent window from the child modal window using parent.close syntax in onload event in child modal window. It actually closes the parent modal window, but the child modal window is not opened, why it is...
6
9945
by: Ramanand.K | last post by:
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(); }
10
4306
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?
1
3571
by: John | last post by:
Hi, I'm having a problem opening / downloading csv files when called from a page opened with window.showModalDialog( ). To isolate this problem, I've written 3 files (see below). 1. main.htm allows the user to open the page containing the link in a regular window or one opened via window.showModalDialog( ) 2. modal.htm provides a link to the aspx which generates the csv 3. csv.aspx generates a csv file
2
4393
by: John | last post by:
Hi, I posted this earlier in microsoft.public.dotnet.framework.aspnet, but didn't get a response, so I thought I'd try here. Basically, I'm having a problem opening / downloading csv files when generated from within a page opened with window.showModalDialog( ) ( IE6 ). To isolate this problem, I've written 3 files (see below). 1. main.htm allows the user to open the page containing the link in a
1
2197
by: Laurahn | last post by:
Hi: i'm using modal window (showmodelessdialog) on asp. when the object is created i used session variables. After the object is closed the data is remaining on the modal window when is open again, even if i clear all session variables. i call the modal windows as: Response.write("<script>window.showModelessDialog('myPage.aspx','window', 'center:Yes;help:No;status:false;dialogWidth:740px;dialogHeight:395px')</script>")
20
2002
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
8767
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
8689
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
9273
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
9136
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9030
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6605
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4703
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2486
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2081
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.