Gossamer Forum
Home : General : Internet Technologies :

showModalDialog POST

Quote Reply
showModalDialog POST
Does anyone know of a way to post a form from a modal dialog and have the result show within the modal dialog?

Currently I'm posting a normal form from a modal dialog, but it always pops up a new browser window to perform the post.

I've tried setting target="self" in the form tag but that seems to do nothing.

Thanks.

Last edited by:

Paul: Apr 25, 2003, 10:24 AM
Quote Reply
Re: [Paul] showModalDialog POST In reply to
Hi Paul

I read somewhere that showmodialdialog doesn't work with all browsers.

Just thought I would mention it.Crazy

Dregs2
Quote Reply
Re: [dregs2] showModalDialog POST In reply to
Yeah I know, it's only an IE thing :(
Quote Reply
Re: [Paul] showModalDialog POST In reply to
Hello Paul,

Here is a link for a not too shabby Javascript modal like child window for IE 4+ and NS 4+.

http://www.devguru.com/...ge_base/A100203.html

Thanks

cornball
Quote Reply
Re: [cornball] showModalDialog POST In reply to
Cool thanks!

Any ideas regarding the OP too?
Quote Reply
Re: [cornball] showModalDialog POST In reply to
Hmm I just tested that example with Netscape 7 and it will only popup the dialog on the first click, after that nothing pops up.
Quote Reply
Re: [Paul] showModalDialog POST In reply to
Hello Paul, I tested it in Netscape 4.74 at first and it seemed to work.

Netscape 6.01 will not allow the child window to close, even with Alt-F4.

And no error messages in the Javascript console.

Wow another Netscape micro manage javascript code per version.

Sorry

Thanks

cornball
Quote Reply
Re: [cornball] showModalDialog POST In reply to
Hi Comball,

It's not really a modal dialog. because if you call an instruction after launching this dialog in NS this instruction will be performed right way without waiting for closing dialog.

IE runs well because it used ShowModalDialog. Using window.open in NS made an incorrect modal dialog.
Quote Reply
Re: [santran] showModalDialog POST In reply to
Hello Santran, Yes NS does not support showModalDialog.

So YES , if you as a web developer do not wait for the quasi

showModialDialog box to close then YES your next statement will execute.



As Clint Eastwood , playing Dirty Harry says :

" Well punk , ya have to ask yourself, do I feel lucky or will I write a

while loop to wait and see if the NS quasi window returns a value or is no

longer in existance [ F4 or X top right ] "

So being a quasi NS Modal kinda window : Do you feel lucky ?



Or are Ya just pointing out That NS now owned By Aol SUCKS for Modal js windows.



Thanks

[ I have seen very few NS browsers visit any site, I have logs for ,in the past year. ]

cornball
Quote Reply
Re: [cornball] showModalDialog POST In reply to
I don't think writting a loop is a solution. Because when you open window by using window.open(). The loop instruction (written under window.open()) will be performed right away while the dialog windows has yet to load completly so you will see a blank disable window.
Quote Reply
Re: [santran] showModalDialog POST In reply to
Hello Santran,

You are saying open the window and then continue ? into the mine field of ......

You can wait and see if the window is created / and or immediately

destroyed by the user or a pop up window killer.

The window is an object under javascript.

-- It has a name

-- it is created and freed [ or not , orphaned ]

-- if it is to pass back variables or data it should be prepared for

the Top right X or F4 or shutdown of windows or other failures to pass info.

If you create a window and it survives creation pass back a variable

that it is has survived creation.

A user can kill a child window , quasi NS modal window.

The parent does not get immediate info on its closure.

You as a quasi web programmer will have to write a function on a timer

that checks to see if the child object still exists. Nailing Jello to the wall !

Obviously if the child exists and returns some valid info then stop the bloody timer .. etc.



Dirty Harry has 1 to 6 rounds in a revolver. Do you wish to play Russian roulette ?



Nobody said programming was fun and free .

See Ya



Cornball


BIG Hint : for the new window onload and onunload will tell the parent window

some information if the parent is listening [ timer stuff , or change a global var in parent ]

Generally as you seem to see it the parent creates the new window and carries on without

giving a care. You as a programmer have to fill this void. There are no other set rules.

You have to see if your child window exists after creation and returns a normal value or is killed

by some other process. That is what programming is all about. (-:

This is general and not related to NS not doing modal stuff like IE, where code stops

while the modal window is open. That is easy stuff. The rest ya write for your self.

Last edited by:

cornball: Dec 22, 2003, 7:29 PM
Quote Reply
Re: [cornball] showModalDialog POST In reply to
I believe that what santran is having problem with is the same issue that I am currently running into. There is no pause mechanism in JavaScript that allows us to easily wait for a response from the child window. I've tried several permutations, and they all have one of 2 issues: either they burn client cpu until the browser crashes, or they chug along to the next bit of code not caring what the status of the (emulated) modal window is. So, Clint Eastwood, is there such a way to pause the javascript thread so that it waits for a response from the child window before continuing (the basis of what a modal window would do)? I've searched around a bit, and have found a consensus that it is not possible. The only way I can see to do it is breaking the calling script up into 2 segments: what happens before (and during creation of) the modal window, and what happens after. That way, when the child window closes, it can call the 2nd half of the script effectively continuing on where we left. Having this type of call and callback design doesn't lend itself too well to a universal method...not to mention, the changes that would need to be made to migrate existing showModalDialog code over would be extensive.
------------------------------
"A good friend once told me, 'ruff, ruff, ruff, ruff, ruff'. I laughed and thought, 'Yup, that about sums it up.'"
Quote Reply
Re: [nixj14] showModalDialog POST In reply to
Hello nixj14,

Try this link for a showModal dialog in IE and NS .

http://javascript.about.com/...ts/blmodaldialog.htm

note : NS has always allowed custom defined showModal dialogs but they must be signed scripts.

Thanks Cornball

ps see attached zip for the example from above.

Last edited by:

cornball: Feb 3, 2004, 9:13 PM
Quote Reply
Re: [cornball] showModalDialog POST In reply to
Cornball, I appreciate the help. I hadn't thought of using DHTML, but it may be an appropriate option for the given task. Thanks for the code.
------------------------------
"A good friend once told me, 'ruff, ruff, ruff, ruff, ruff'. I laughed and thought, 'Yup, that about sums it up.'"
Quote Reply
Re: [nixj14] showModalDialog POST In reply to
Hello Nixj14, Have a look at this link for a "cross browser" ShowModal dialog .

http://www.devguru.com/...ge_base/A100203.html


I tested in IE 6 and NS 7 and it does create a reasonable Modal child window.

Good Luck.

cornball
Quote Reply
Re: [cornball] showModalDialog POST In reply to
A quick and very simple example in attached sample.zip

Tested with IE 6 and NS 7 on Win XP.

I wonder if this will work on Linux and MAC .... ?

thanks
cornball