473,671 Members | 2,376 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What do I have to change to get this to work?

This works:

Main window:
<html>
<head>
<title>Untitl ed Document</title>
<script>
function openSub(){
window.open("Pr intwindow.htm", "pw","height=20 0px, width=300px, left=300px,
top=300px")
}
</script>
</head>

<body>
<form id='form1' name="form1">
<input type="text" name="textfield ">
<input type="button" name="Test" value="Test" onClick="openSu b();">
</form>
</body>
</html>

Sub window:
<html>
<head>
<title>Untitl ed Document</title>
<script type="text/javascript">
function sendMe(txt){
opener.form1.te xtfield.value=t xt;
}
</script>
</head>

<body>
<form name="frm">
<input name="btn1" type="button" onClick="sendMe ('test');" value="Test">
</form>
</body>
</html>

but if I change the window.open to window.showModa lDialog it doesn't work
any more. How do I send stuff back to the calling window if the callee has
been opened as a modaldialog window?

Thanks
iv**@tda.no
Jan 12 '06 #1
5 1338
VK

Iver Erling Årva wrote:
How do I send stuff back to the calling window if the callee has
been opened as a modaldialog window?


By closing your ModalDialog. ;-)
var userChoice = window.showModa lDialog(args);

Why do you think it's called "modal" and "dialog"? It is just
Microsoft's proprietary (though useful) way to display rich formatted
dialog windows. But by its nature and execution mechanics it's the same
as:
var userChoice = window.confirm( 'OK or Cancel?');

Jan 12 '06 #2
Iver Erling Årva wrote:
This works:

Main window:
<html>
<head>
<title>Untitl ed Document</title>
<script>
function openSub(){
window.open("Pr intwindow.htm", "pw","height=20 0px, width=300px,
left=300px,
top=300px")
Should be ended with a semi-colon ...
}
</script>
</head>

<body>
<form id='form1' name="form1">
.... and is not Valid anyway.

<URL:http://validator.w3.or g/>
[...]
Sub window:
<html>
<head>
<title>Untitl ed Document</title>
<script type="text/javascript">
function sendMe(txt){
opener.form1.te xtfield.value=t xt;
}
</script>
</head>

<body>
<form name="frm">
It is much the same here.
<input name="btn1" type="button" onClick="sendMe ('test');" value="Test">
</form>
</body>
</html>

but if I change the window.open to window.showModa lDialog it doesn't work
any more.
In fact, it is rather surprising it already worked without that. For
window.open(), features in the third argument for window.open() are to
be comma-separated, not comma-space-separated.

<URL:http://docs.sun.com/source/816-6408-10/window.htm#1202 731>
<URL:http://msdn.microsoft. com/workshop/author/dhtml/reference/methods/open_0.asp>

And the syntax is different for IE-only window.showModa lDialog(): the
features have to be separated by semi-colon there:

<URL:http://msdn.microsoft. com/workshop/author/dhtml/reference/methods/showmodaldialog .asp>
How do I send stuff back to the calling window if the callee has
been opened as a modaldialog window?


As was said, by closing it.
PointedEars
Jan 12 '06 #3
VK

VK wrote:
Iver Erling Årva wrote:
How do I send stuff back to the calling window if the callee has
been opened as a modaldialog window?


Actually check for showModelessDia log instead and
dlgObject.dialo gArguments property
<http://msdn.microsoft. com/workshop/author/dhtml/reference/methods/showmodelessdia log.asp>

If you have more questions of their usage I guess they are better
suited for microsoft.publi c.scripting.jsc ript as not too many people
here ever used them actively (?)

Jan 12 '06 #4
>> How do I send stuff back to the calling window if the callee has
been opened as a modaldialog window?
As was said, by closing it.
The problem is that unfortunately closing it is not an option. The window is
generated by a program that opens a modal window and uses it to show a print
preview. If it is a big report, it can take long to display the first page
and I therefore want to send information back to the opener so it can
display some sort of progress status info while the report is being
generated. The good thing is that I have access to part of the code and
therefore could add code to send stuff back, but part of the code is an
active x and isn't mine. It is in that part the window is opened - hence I
cannot change the way it is done.

Iv**@tda.no


"Thomas 'PointedEars' Lahn" <Po*********@we b.de> skrev i melding
news:14******** ********@Pointe dEars.de... Iver Erling Årva wrote:
This works:

Main window:
<html>
<head>
<title>Untitl ed Document</title>
<script>
function openSub(){
window.open("Pr intwindow.htm", "pw","height=20 0px, width=300px,
left=300px,
top=300px")
Should be ended with a semi-colon ...

Yes, I know.
}
</script>
</head>

<body>
<form id='form1' name="form1">


... and is not Valid anyway.

<URL:http://validator.w3.or g/>
[...]
Sub window:
<html>
<head>
<title>Untitl ed Document</title>
<script type="text/javascript">
function sendMe(txt){
opener.form1.te xtfield.value=t xt;
}
</script>
</head>

<body>
<form name="frm">


It is much the same here.
<input name="btn1" type="button" onClick="sendMe ('test');" value="Test">
</form>
</body>
</html>

but if I change the window.open to window.showModa lDialog it doesn't work
any more.


In fact, it is rather surprising it already worked without that. For
window.open(), features in the third argument for window.open() are to
be comma-separated, not comma-space-separated.

<URL:http://docs.sun.com/source/816-6408-10/window.htm#1202 731>
<URL:http://msdn.microsoft. com/workshop/author/dhtml/reference/methods/open_0.asp>

And the syntax is different for IE-only window.showModa lDialog(): the
features have to be separated by semi-colon there:

<URL:http://msdn.microsoft. com/workshop/author/dhtml/reference/methods/showmodaldialog .asp>
How do I send stuff back to the calling window if the callee has
been opened as a modaldialog window?


As was said, by closing it.
PointedEars

Jan 13 '06 #5
Iver Erling Årva wrote:
How do I send stuff back to the calling window if the callee has
been opened as a modaldialog window?
As was said, by closing it.


Please provide attribution of quoted material.
The problem is that unfortunately closing it is not an option. The window
is generated by a program that opens a modal window and uses it to show a
print preview. If it is a big report, it can take long to display the
first page and I therefore want to send information back to the opener so
it can display some sort of progress status info while the report is being
generated. The good thing is that I have access to part of the code
and therefore could add code to send stuff back [...]
It is nonsense to block the UA this long. So do not use a modal dialog
here, and modify the code so that it does not open one in the first place.
[Top post]


Please learn to quote.

<URL:http://jibbering.com/faq/faq_notes/pots1.html#ps1P ost>
PointedEars
Jan 13 '06 #6

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

Similar topics

220
19002
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have any preconceived ideas about it. I have noticed, however, that every programmer I talk to who's aware of Python is also talking about Ruby. So it seems that Ruby has the potential to compete with and displace Python. I'm curious on what basis it...
125
14711
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from software giant such as Microsoft SQL Server, Oracle, and Sybase? Is PostgreSQL reliable enough to be used for high-end commercial application? Thanks
86
7756
by: Michael Kalina | last post by:
Because when I asked for comments on my site-design (Remember? My site, your opinion!) some of you told me never to change anything on font-sizes! What do you guys think of that: http://www.clagnut.com/blog/348/ I hope that's going to be a good discussion! Michael
121
10042
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode support IDEs are DreamWeaver 8 and Zend PHP Studio. DreamWeaver provides full support for Unicode. However, DreamWeaver is a web editor rather than a PHP IDE. It only supports basic IntelliSense (or code completion) and doesn't have anything...
39
3212
by: windandwaves | last post by:
Hi Folk I have to store up to eight boolean bits of information about an item in my database. e.g. with restaurant drive-through facility yellow windows
669
25866
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic paper written on this subject. On the Expressive Power of Programming Languages, by Matthias Felleisen, 1990. http://www.ccs.neu.edu/home/cobbe/pl-seminar-jr/notes/2003-sep-26/expressive-slides.pdf
9
3184
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will load with different data (locations, departments, etc.).
1
2202
by: JustMe | last post by:
Hi all, Although I've got quite a lot of experience with php and (M/My)SQL, I only used both within an online php script. These last few months I bought an option with my webhost to access the remote database via ODBC via my homePC. I use MS Access (linked tables) on my PC, just because it's very easy to make new reports / forms / querys / ... And, in principle, it should work, shouldn't it? And it does... most of the time,...
6
1477
by: plemon | last post by:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <script type="text/javascript">var v11 = + $0; var v12 = + $25; var v13 = + $75 var v14 = + $100; function f1()
123
6418
by: plenty900 | last post by:
I was looking over someone's C++ code today and despite having written perfectly readable C++ code myself, the stuff I was looking at was worse than legalese. The people who are guiding the development of C++ have really made a mess of things, I mean templates and competing libraries and all that just render the code impossible to comprehend. Sure there is going to be a certain amount of complexity, that's a given, but if code is not...
0
8397
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
8919
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
8670
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
7439
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
5696
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
4225
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4409
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2052
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1810
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.