473,416 Members | 1,548 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,416 software developers and data experts.

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="yes").

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

I know that we can use window.showModalDialog(), 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 12495
"amith" <it*******@yahoo.co.in> wrote in message
news:90*************************@posting.google.co m...
<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="yes").
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.showModalDialog(),
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
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...
2
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...
1
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...
6
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 =...
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...
1
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...
2
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...
1
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...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
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...
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
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...
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
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,...
0
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...

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.