Link to home
Create AccountLog in
Avatar of garethtnash
garethtnashFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VBScript Close iframe after data update

Hello,

I have a form that opens in an iframe, and allows users to update a database entry. I'm going to set the form to post back to itself, which will allow the database update stored procedure to fire. What I need to do, is once the stored procedure has run, automatically close the iframe...


possible?

my code that runs the stored procedure reads like so --

<%
if request("updatenote") = "Y" and request("NoteID") <> "" then 

Dim CMDUpdateNote__ID
CMDUpdateNote__ID = NULL
if(Request("NoteID") <> "") then CMDUpdateNote__ID = Request("NoteID")

Dim CMDUpdateNote__MemberID
CMDUpdateNote__MemberID = NULL
if(Request("MemberID") <> "") then CMDUpdateNote__MemberID = Request("MemberID")

Dim CMDUpdateNote__SupplierID
CMDUpdateNote__SupplierID = NULL
if(Request("SupplierID") <> "") then CMDUpdateNote__SupplierID = Request("SupplierID")

Dim CMDUpdateNote__BrandID
CMDUpdateNote__BrandID = NULL
if(Request("BrandID") <> "") then CMDUpdateNote__BrandID = Request("BrandID")

Dim CMDUpdateNote__ContactID
CMDUpdateNote__ContactID = NULL
if(Request("ContactID") <> "") then CMDUpdateNote__ContactID = Request("ContactID")

Dim CMDUpdateNote__HContactID
CMDUpdateNote__HContactID = NULL
if(Request("HContactID") <> "") then CMDUpdateNote__HContactID = Request("HContactID")

Dim CMDUpdateNote__notes
CMDUpdateNote__notes = NULL
if(Request("notes") <> "") then CMDUpdateNote__notes = Request("notes")

set CMDUpdateNote = Server.CreateObject("ADODB.Command")
CMDUpdateNote.ActiveConnection = MM_GolfConnection_STRING
CMDUpdateNote.CommandText = "dbo.UpdateEditNote"
CMDUpdateNote.CommandType = 4
CMDUpdateNote.CommandTimeout = 0
CMDUpdateNote.Prepared = true
CMDUpdateNote.Parameters.Append CMDUpdateNote.CreateParameter("@RETURN_VALUE", 3, 4)
CMDUpdateNote.Parameters.Append CMDUpdateNote.CreateParameter("@ID", 3, 1,4,CMDUpdateNote__ID)
CMDUpdateNote.Parameters.Append CMDUpdateNote.CreateParameter("@MemberID", 3, 1,4,CMDUpdateNote__MemberID)
CMDUpdateNote.Parameters.Append CMDUpdateNote.CreateParameter("@SupplierID", 3, 1,4,CMDUpdateNote__SupplierID)
CMDUpdateNote.Parameters.Append CMDUpdateNote.CreateParameter("@BrandID", 3, 1,4,CMDUpdateNote__BrandID)
CMDUpdateNote.Parameters.Append CMDUpdateNote.CreateParameter("@ContactID", 3, 1,4,CMDUpdateNote__ContactID)
CMDUpdateNote.Parameters.Append CMDUpdateNote.CreateParameter("@HContactID", 3, 1,4,CMDUpdateNote__HContactID)
CMDUpdateNote.Parameters.Append CMDUpdateNote.CreateParameter("@notes", 200, 1,5000,CMDUpdateNote__notes)
CMDUpdateNote.Execute()

End if
%>

Open in new window


Thank you
ASKER CERTIFIED SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of garethtnash

ASKER

Thanks Padas
Glad that worked. Easy!