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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Popup window and close

Status
Not open for further replies.

bebig

Technical User
Oct 21, 2004
111
US
I have popup window.
when I click "Submit Schedule", I want to close popup window at the same time.
Would you please tell me how to do ??
==========================================================

puts "<form name=Form2 method=post>"
puts "<p><center><INPUT type=\"button\" value=\"Submit Schedule\" name=B3 style=\"font-family: Verdana; font-size: 11px\" onclick=\"return OnButton2();\"></center>\n"
puts "</form>"
puts "</body>\n"
puts "</html>\n"

puts "<script>"
puts "<!--"
puts "function OnButton2() {"
puts " document.Form2.action = \"newsubmitschedules.tcl\""
puts " document.Form2.submit();"
puts " return true;"
puts "}"
puts "//-->"
puts "</script>"
 
To elaborate:

Code:
puts "function OnButton2() {"
puts "    document.Form2.action = \"newsubmitschedules.tcl\";"
puts "    document.Form2.submit();" 
puts "    window.close();"   
puts "    return true;"
puts "}"

*cLFlaVA
----------------------------
[tt]insert funny quotation here.[/tt]
 
Well. I tried it...But it does not work..
Could you please help me??
 
oh..it works.
But, I dont want to ask "do you want to close window?"
I just want to close after I click submit button.
Would you please help?
 
not sure if this has anything to do with it, but I've never put script outside of the closing <html> tag. Try putting it between the <head></head> tags, which is the ideal location for it.

*cLFlaVA
----------------------------
[tt]insert funny quotation here.[/tt]
 
Asking for permission is a standard security procedure when closing a window that was not opened with Javascript. There are numerous ways ("hacks") to get around this, such as
Code:
opener = self;
self.close();

--Chessbot

There is a level of Hell reserved for probability theorists in which every monkey that types on a typewriter produces a Shakespearean sonnet.
 
which, luckily, will only work in IE. The other browsers realize my right to privacy and security :)

*cLFlaVA
----------------------------
[tt]insert funny quotation here.[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top