Forums
This topic is locked
Autoclose a the window after Update Record
Posted 20 Jul 2002 16:37:33
1
has voted
20 Jul 2002 16:37:33 Mitchel Tendler posted:
I have a report that lists a bunch of students.When you click on the student name, it opens up a new page with the an update form, I want to set it up so after a person clicks on the UPDATE button, the record is updated and the window closes, leaving ther person with the original list of names.
How can I do this...help?
Thanks!
Mitch
Replies
Replied 20 Jul 2002 18:48:11
20 Jul 2002 18:48:11 aegis kleais replied:
Well, I sorta don't recommend that you close the window without some kinda confirmation page, but nonetheless, try the following:
Setup the UPDATE SB so that after update, it goes to:
if page is called update.asp
setup for it to goto update.asp?sent=yes
Then in your page code try:
-----------------------------------------------------------
<html>
<head>
<%
If Request.QueryString("sent" = "yes" then
Response.Write("<script language='javascript'>"
Response.Write("<!--"
Response.Write("Self.Close();"
Response.Write("//-->"
Response.Write("</script>"
End If
%>
</head>
<body>
........
---------------------------------------------------------
This should basically now see the sent=yes value that is now appended to the end of the URL and write code which'll add javascript's self.close() function, which'll close the window on page load.
Aegis Kleais
New Media Web Developer
(DWMX : IIS5.1 : SQL2K : WXP : ASP[VB/JS])
Setup the UPDATE SB so that after update, it goes to:
if page is called update.asp
setup for it to goto update.asp?sent=yes
Then in your page code try:
-----------------------------------------------------------
<html>
<head>
<%
If Request.QueryString("sent" = "yes" then
Response.Write("<script language='javascript'>"
Response.Write("<!--"
Response.Write("Self.Close();"
Response.Write("//-->"
Response.Write("</script>"
End If
%>
</head>
<body>
........
---------------------------------------------------------
This should basically now see the sent=yes value that is now appended to the end of the URL and write code which'll add javascript's self.close() function, which'll close the window on page load.
Aegis Kleais
New Media Web Developer
(DWMX : IIS5.1 : SQL2K : WXP : ASP[VB/JS])