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

Modal Windows

20
Could anyone help me in creating modal windows? I tried using window.showModalDialog , it worked in opening the modal window. But I am facing the following issues.
1. On submit from the modal window, it is opening another window, it should be in the same window where submit happened.
2. how can i pass the values from the modal window to parent window. I tried using window.opener.document. ....
but it is throwing javascript error

thanks for ur help
Aug 11 '09 #1
11 3550
Dormilich
8,658 Expert Mod 8TB
there seems to be something wrong with your code…

showModalDialog() @ MDC
Aug 11 '09 #2
paull
20
But i need to return more than one values to the parent windows. how is it possible. I have some hidden fields in the parent window and I need to set the values to that hidden variables from the modal window..
Aug 11 '09 #3
Dormilich
8,658 Expert Mod 8TB
put them into an array or object and return this. see also the MSDN description.
Aug 11 '09 #4
paull
20
actually what i need is to close the modal window and submit the parent window, before submitting i need to assign some values to the variables in the parent window

the following is my close function in the modal window.
window.opener.document.forms[0].action="act.do?method=view";
window.opener.document.forms[0].ncId.value=ncId;
window.opener.document.forms[0].submit();
window.close();
Aug 11 '09 #5
Dormilich
8,658 Expert Mod 8TB
you can also do that right after the modal window was closed using its return value (assuming you use an object to get multiple values)
Aug 11 '09 #6
paull
20
hi ,. m not clear with the reply. could u plz explain more?
Aug 11 '09 #7
Dormilich
8,658 Expert Mod 8TB
OK, something like
Expand|Select|Wrap|Line Numbers
  1. // assuming you return an object: {id: "id_value", page: "act.do?method=view"}
  2. var r = window.showModalDialog(…);
  3. document.forms[0].ncId.value = r.id;
  4. document.forms[0].action = r.page;
Aug 11 '09 #8
paull
20
how will we assign the return values from the modal window?

var r = window.showModalDialog(…);

i mean, from where the value for r is assigned ? in my modal window, on click on close button , it should close the modal window and then submit of parent window should happen...
Aug 11 '09 #9
Dormilich
8,658 Expert Mod 8TB
@paull
from within the modal window, see MSDN for further explanation.
Aug 11 '09 #10
paull
20
how can i submit an action to another jsp page from modal window. ...

I use struts...
Aug 12 '09 #11
Dormilich
8,658 Expert Mod 8TB
use the submit() method.
Aug 12 '09 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Nonoy of Philippines | last post by:
Hello, guys... I'm just starting to develop web applications and I have this problem regarding Session objects At some parts of my application, I open modal dialog window which also opens...
0
by: Hector | last post by:
I have a ComboBox set up in a non-modal form. When a selection is made from the ComboBox, the handler code closes the form, but then the system crashes because of an unhandled NullReferenceException....
3
by: Andrew | last post by:
I get a Null Reference Exception if I close a non-modal dialog (that is, a form opened with Show()) when a selection is made from a ComboBox. The error message refers to Unsafe Native Methods, but...
8
by: Stephen Rice | last post by:
Hi, I have a periodic problem which I am having a real time trying to sort. Background: An MDI VB app with a DB on SQL 2000. I have wrapped all the DB access into an object which spawns a...
5
by: jacquesvdz | last post by:
Hi Hope you guys can help me with this? I live in a house with 10 people.In the beginning wehn there were only two people, I gave them my password for the use of my pc. But since I got...
23
by: Chukkalove | last post by:
Im sorry, I dont know the correct description for a hierarchy of parent and child forms. I have a main form that opens a child form modally. This child form in turn opens it's own child form...
2
by: Mike | last post by:
Hi, I'm having a problem with modal forms on windows. I've written a very short test program, with a main window and a form called from the main window. The form is set to modal with...
4
by: John Kotuby | last post by:
Hi all... I am bulding an application and wish to use custom Modal dialog windows. According to a couple of recent articles I have seen, the newer Mozilla browsers (actually I think they said...
2
by: =?Utf-8?B?TmF0aGFuIFdpZWdtYW4=?= | last post by:
Hi, I am wondering why the .NET Framework is quite different from Win32 API when it comes to displaying system modal message boxes. Consider the four following types of system modal message...
3
by: aagarwal8 | last post by:
Hi, I have a main form, which i use to open secondary forms. From the secondary form i need to open a Modal Window in such a way that, my secondary form is blocked, but i can still access my...
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
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
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,...
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
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,...

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.