/    Sign up×
Community /Pin to ProfileBookmark

questions on child windows…..

i am opening a popup from a parent window…using window.open

i always want the focus to be on the child window (unless the user closed teh child window by clicking on cancel button) and i dont want to allow the user to be able to click on the parent window when this child window is open.

i also want to disable the “close window – X” option for the child window – the user shld be able to close the child window only by clicking on the cancel button in the window…

how do we do this?…

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@pixelmechNov 17.2003 — [i]Originally posted by suganya [/i]

[B]i am opening a popup from a parent window...using window.open



i always want the focus to be on the child window (unless the user closed teh child window by clicking on cancel button) and i dont want to allow the user to be able to click on the parent window when this child window is open.



i also want to disable the "close window - X" option for the child window - the user shld be able to close the child window only by clicking on the cancel button in the window...



how do we do this?... [/B]
[/QUOTE]


In short, you don't. What you are talking about is called a "modal dialog." It mimics application like behavior. You can attempt various JS tricks with focus and so on, using chromeless windows but you will drive yourself nuts and you will not ever be 100% successful.

There is such a thing as a modal dialog, but it is IE ONLY. If you are using IE only then go nuts. Read more here:

http://www.webreference.com/js/column90/

My suggestion is to rethink your application. Are the popups *absolutely* necessary? Usually it turns out they are not. Why not use a normal page? Then you have complete control.

If you must have this in a popup and you aren't in an IE only environment you are in for a world of pain ?. Read the article above and post back if you are still in trouble.

Tom
Copy linkTweet thisAlerts:
@suganyaauthorNov 17.2003 — Tom,

Thanks for your response...

Yes, i am using IE ONLY!...

the reason i am having popups is:

The app basically has to do this - something like a wizard...take the user thru 4/5 steps (each step a dialog, in this case) and based on the user's response, another browser window is opened or another dialog is openend with a question.

I did try the modal dialog option - it works perfectly fine except that i am not able to fix this problem if i have it as modal!.. - opening a browser window based on the user click, i am having no problem BUT WHEN I HAVE TO THROW ANOTHER QUESTION AT THE USER (NEXT STEP IN THE WIZARD LIKE PROCESS), IT HAS TO BE IN THE SAME MODAL DIALOG AND THIS IS WHAT I AM NOT GETTING. I WANT TO SUBMIT THE FORM AND SHOW ANOTHER FORM TO THE USER IN THE SAME DIALOG.


I did earlier post requesting help for this, but no luck!...so, if you think i could achieve this using the modal dialog, then that would be of great help to me...

thanks much

Suganya
Copy linkTweet thisAlerts:
@pixelmechNov 17.2003 — [i]Originally posted by suganya [/i]

[B]BUT WHEN I HAVE TO THROW ANOTHER QUESTION AT THE USER (NEXT STEP IN THE WIZARD LIKE PROCESS), IT HAS TO BE IN THE SAME MODAL DIALOG AND THIS IS WHAT I AM NOT GETTING. I WANT TO SUBMIT THE FORM AND SHOW ANOTHER FORM TO THE USER IN THE SAME DIALOG. [/B][/QUOTE]


Yes I believe that is a property of it being modal. You have to deal with that window before you do anything else. Sounds to me like you simply have too many popups going on. You really should only expect the user to deal with a single window at a time.

You should be able to submit a form to the modalDialog window..are you saying you can't? Have some code or a URL to show?

Tom
×

Success!

Help @suganya spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...