Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Manipulating close window function

Status
Not open for further replies.

lexx2gee

Programmer
Joined
Mar 1, 2005
Messages
56
Location
GB
Hi all,

Was wondering if its possible to manipulate the code for closing pop up windows

ie onclick="clswin();"

To add conditions, something like it can only close if all check boxes are ticked. Or do I need to get some java script to do this?

Any suggestions welcome!

Thanks

P
 
I think you have to use client side script to check those conditions first then use window.close() to close it.
 
cant do that (even with javascript). a popup window is meant to be an aid to the web user not a problem...

Known is handfull, Unknown is worldfull
 
I know a pop up should be helpful but this is a case where its used to fulfill legal requirements. If my customer selects to add insurance to there booking it forces a pop window containing some t's & C's and then 3 check boxes which must be ticked to close the window and proceed with the booking (in theory)!

Cheers

P
 
I guess that depends on if, by popup window, you mean a messagebox like is launched with the javascript alert() function or another browser.
 
I could use either depending on what will be easier. Its just the stupid FSA and there beurocratic new rules for dealing with insurance!
 
rather than doing that do this:
1. have a hidden file in the main page.
2. Have a submit button in the main page. if this submit button is clicked it will check the hidden field's value (which will be empty the first time). if the value is empty open the popup.
3. Open popup. if the conditions fulfills in the popup using window.opener() set the hidden value's value to lets say "Y". and submit the main page (using window.opener() again).


if a user closes the popup using "X" the hidden field's value will not be set.
therefore if the user tries to submit the page the popup will open once again (as hidden field's value is not set)...



Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top