Hi Guys

Wonder if someone can help me with this.

I have a form where a user clicks a button which gives them a pop up windows
to allow them to add the data. The user adds the data and click save. The
pop window closes and refreshs the parent window to allow the entered data
to be displayed.

It was all working okay until couple of days back when it stopped.

Can someone offer any help. I have posted the relevant code here. Please let
me know if you need to see all code.

Thanks

Jas

<body bgcolor="#FFFFFF" text="#000000" onLoad =
"checkClose('<%=bCloseWindow%>')">

function checkClose(flagClose){
if(flagClose==1) {
window.opener.document.thisForm.action = "createExpense.asp"
window.opener.document.thisForm.htbAction.value = "edit"
window.opener.document.thisForm.htbMode.value = "edit"
window.opener.document.thisForm.submit()
self.close()
}


Sub AddExpense()
Dim Rs

GetPostData()
sql = "Insert into expenseDetails (ExpenseId, ExpenseDate, Type,"
sql = sql & "Amount, City, Notes, Receipt, Billable, Bartered,
BarteredDetails"
sql = sql & ") values ("
sql = sql & "'" & strExpenseId & "',"
sql = sql & "'" & strDate & "',"
sql = sql & "'" & strType & "',"
sql = sql & "'" & strAmount & "',"
sql = sql & "'" & strCity & "',"
sql = sql & "'" & strNotes & "',"
sql = sql & "'" & strReceipt & "',"
sql = sql & "'" & strBillable & "',"
sql = sql & "'" & strBarter & "',"
sql = sql & "'" & strBarterDetails & "x'"
sql = sql & ")"
Response.write sql
conn.execute sql
'Get the new detail id
sql = "Select Max(expenseDetailId) as ExpenseDetailId from expenseDetails
where expenseId = " & strExpenseId

set Rs = server.createobject("ADODB.recordset")
Rs.open Sql,conn,1,3
If not Rs.Eof Then
strDetailId = Rs("ExpenseDetailId")
If strBillable = "1" Then AddBillableExpense()
End If
bCloseWindow = "1"

End Sub

Re: Close pop window and refresh the parent window by Alex

Alex
Thu Feb 05 04:17:07 CST 2004

what does "stopped" mean?? do you get an error message? what exactly is the
problem?

"J P Singh" <noemail@asIhatespam> wrote in message
news:%23gbFb$86DHA.1816@TK2MSFTNGP12.phx.gbl...
> Hi Guys
>
> Wonder if someone can help me with this.
>
> I have a form where a user clicks a button which gives them a pop up
windows
> to allow them to add the data. The user adds the data and click save. The
> pop window closes and refreshs the parent window to allow the entered data
> to be displayed.
>
> It was all working okay until couple of days back when it stopped.
>
> Can someone offer any help. I have posted the relevant code here. Please
let
> me know if you need to see all code.
>
> Thanks
>
> Jas
>
> <body bgcolor="#FFFFFF" text="#000000" onLoad =
> "checkClose('<%=bCloseWindow%>')">
>
> function checkClose(flagClose){
> if(flagClose==1) {
> window.opener.document.thisForm.action = "createExpense.asp"
> window.opener.document.thisForm.htbAction.value = "edit"
> window.opener.document.thisForm.htbMode.value = "edit"
> window.opener.document.thisForm.submit()
> self.close()
> }
>
>
> Sub AddExpense()
> Dim Rs
>
> GetPostData()
> sql = "Insert into expenseDetails (ExpenseId, ExpenseDate, Type,"
> sql = sql & "Amount, City, Notes, Receipt, Billable, Bartered,
> BarteredDetails"
> sql = sql & ") values ("
> sql = sql & "'" & strExpenseId & "',"
> sql = sql & "'" & strDate & "',"
> sql = sql & "'" & strType & "',"
> sql = sql & "'" & strAmount & "',"
> sql = sql & "'" & strCity & "',"
> sql = sql & "'" & strNotes & "',"
> sql = sql & "'" & strReceipt & "',"
> sql = sql & "'" & strBillable & "',"
> sql = sql & "'" & strBarter & "',"
> sql = sql & "'" & strBarterDetails & "x'"
> sql = sql & ")"
> Response.write sql
> conn.execute sql
> 'Get the new detail id
> sql = "Select Max(expenseDetailId) as ExpenseDetailId from expenseDetails
> where expenseId = " & strExpenseId
>
> set Rs = server.createobject("ADODB.recordset")
> Rs.open Sql,conn,1,3
> If not Rs.Eof Then
> strDetailId = Rs("ExpenseDetailId")
> If strBillable = "1" Then AddBillableExpense()
> End If
> bCloseWindow = "1"
>
> End Sub
>
>



Re: Close pop window and refresh the parent window by J

J
Thu Feb 05 05:55:16 CST 2004

Sorry for not being clear enough.

What it does is it adds the data to the table but doesnot close the window.
I have to manually close the pop up window and then press F5 to refresh the
screen and the data i have entered shows up but I would want the pop up
window to close automatically with the back window refreshed.

Thanks

Jas

"Alex Goodey" <agoodey@hsfinancial.co.uk> wrote in message
news:bvt51m$102eg4$1@ID-221525.news.uni-berlin.de...
> what does "stopped" mean?? do you get an error message? what exactly is
the
> problem?
>
> "J P Singh" <noemail@asIhatespam> wrote in message
> news:%23gbFb$86DHA.1816@TK2MSFTNGP12.phx.gbl...
> > Hi Guys
> >
> > Wonder if someone can help me with this.
> >
> > I have a form where a user clicks a button which gives them a pop up
> windows
> > to allow them to add the data. The user adds the data and click save.
The
> > pop window closes and refreshs the parent window to allow the entered
data
> > to be displayed.
> >
> > It was all working okay until couple of days back when it stopped.
> >
> > Can someone offer any help. I have posted the relevant code here. Please
> let
> > me know if you need to see all code.
> >
> > Thanks
> >
> > Jas
> >
> > <body bgcolor="#FFFFFF" text="#000000" onLoad =
> > "checkClose('<%=bCloseWindow%>')">
> >
> > function checkClose(flagClose){
> > if(flagClose==1) {
> > window.opener.document.thisForm.action = "createExpense.asp"
> > window.opener.document.thisForm.htbAction.value = "edit"
> > window.opener.document.thisForm.htbMode.value = "edit"
> > window.opener.document.thisForm.submit()
> > self.close()
> > }
> >
> >
> > Sub AddExpense()
> > Dim Rs
> >
> > GetPostData()
> > sql = "Insert into expenseDetails (ExpenseId, ExpenseDate, Type,"
> > sql = sql & "Amount, City, Notes, Receipt, Billable, Bartered,
> > BarteredDetails"
> > sql = sql & ") values ("
> > sql = sql & "'" & strExpenseId & "',"
> > sql = sql & "'" & strDate & "',"
> > sql = sql & "'" & strType & "',"
> > sql = sql & "'" & strAmount & "',"
> > sql = sql & "'" & strCity & "',"
> > sql = sql & "'" & strNotes & "',"
> > sql = sql & "'" & strReceipt & "',"
> > sql = sql & "'" & strBillable & "',"
> > sql = sql & "'" & strBarter & "',"
> > sql = sql & "'" & strBarterDetails & "x'"
> > sql = sql & ")"
> > Response.write sql
> > conn.execute sql
> > 'Get the new detail id
> > sql = "Select Max(expenseDetailId) as ExpenseDetailId from
expenseDetails
> > where expenseId = " & strExpenseId
> >
> > set Rs = server.createobject("ADODB.recordset")
> > Rs.open Sql,conn,1,3
> > If not Rs.Eof Then
> > strDetailId = Rs("ExpenseDetailId")
> > If strBillable = "1" Then AddBillableExpense()
> > End If
> > bCloseWindow = "1"
> >
> > End Sub
> >
> >
>
>



Re: Close pop window and refresh the parent window by hrothenb

hrothenb
Tue Feb 10 19:59:49 CST 2004

You can use the following to refresh the parent window and close the current window:

<script language="JavaScript">
<!--
function refreshParent()
{
window.opener.location.href = window.opener.location.href;
window.close();
}
//-->
</script>



"J P Singh" <noemail@asIhatespam> wrote in message news:<egQtt796DHA.1592@TK2MSFTNGP10.phx.gbl>...
> Sorry for not being clear enough.
>
> What it does is it adds the data to the table but doesnot close the window.
> I have to manually close the pop up window and then press F5 to refresh the
> screen and the data i have entered shows up but I would want the pop up
> window to close automatically with the back window refreshed.
>
> Thanks
>
> Jas
>
> "Alex Goodey" <agoodey@hsfinancial.co.uk> wrote in message
> news:bvt51m$102eg4$1@ID-221525.news.uni-berlin.de...
> > what does "stopped" mean?? do you get an error message? what exactly is
> the
> > problem?
> >
> > "J P Singh" <noemail@asIhatespam> wrote in message
> > news:%23gbFb$86DHA.1816@TK2MSFTNGP12.phx.gbl...
> > > Hi Guys
> > >
> > > Wonder if someone can help me with this.
> > >
> > > I have a form where a user clicks a button which gives them a pop up
> windows
> > > to allow them to add the data. The user adds the data and click save.
> The
> > > pop window closes and refreshs the parent window to allow the entered
> data
> > > to be displayed.
> > >
> > > It was all working okay until couple of days back when it stopped.
> > >
> > > Can someone offer any help. I have posted the relevant code here. Please
> let
> > > me know if you need to see all code.
> > >
> > > Thanks
> > >
> > > Jas
> > >
> > > <body bgcolor="#FFFFFF" text="#000000" onLoad =
> > > "checkClose('<%=bCloseWindow%>')">
> > >
> > > function checkClose(flagClose){
> > > if(flagClose==1) {
> > > window.opener.document.thisForm.action = "createExpense.asp"
> > > window.opener.document.thisForm.htbAction.value = "edit"
> > > window.opener.document.thisForm.htbMode.value = "edit"
> > > window.opener.document.thisForm.submit()
> > > self.close()
> > > }
> > >
> > >
> > > Sub AddExpense()
> > > Dim Rs
> > >
> > > GetPostData()
> > > sql = "Insert into expenseDetails (ExpenseId, ExpenseDate, Type,"
> > > sql = sql & "Amount, City, Notes, Receipt, Billable, Bartered,
> > > BarteredDetails"
> > > sql = sql & ") values ("
> > > sql = sql & "'" & strExpenseId & "',"
> > > sql = sql & "'" & strDate & "',"
> > > sql = sql & "'" & strType & "',"
> > > sql = sql & "'" & strAmount & "',"
> > > sql = sql & "'" & strCity & "',"
> > > sql = sql & "'" & strNotes & "',"
> > > sql = sql & "'" & strReceipt & "',"
> > > sql = sql & "'" & strBillable & "',"
> > > sql = sql & "'" & strBarter & "',"
> > > sql = sql & "'" & strBarterDetails & "x'"
> > > sql = sql & ")"
> > > Response.write sql
> > > conn.execute sql
> > > 'Get the new detail id
> > > sql = "Select Max(expenseDetailId) as ExpenseDetailId from
> expenseDetails
> > > where expenseId = " & strExpenseId
> > >
> > > set Rs = server.createobject("ADODB.recordset")
> > > Rs.open Sql,conn,1,3
> > > If not Rs.Eof Then
> > > strDetailId = Rs("ExpenseDetailId")
> > > If strBillable = "1" Then AddBillableExpense()
> > > End If
> > > bCloseWindow = "1"
> > >
> > > End Sub
> > >
> > >
> >
> >