Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 11:41 AM
J P Singh
Guest
 
Posts: n/a
Default Close pop window and refresh the parent window

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


  #2  
Old July 19th, 2005, 11:41 AM
Alex Goodey
Guest
 
Posts: n/a
Default Re: Close pop window and refresh the parent window

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...[color=blue]
> 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[/color]
windows[color=blue]
> 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[/color]
let[color=blue]
> 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
>
>[/color]


  #3  
Old July 19th, 2005, 11:41 AM
J P Singh
Guest
 
Posts: n/a
Default Re: Close pop window and refresh the parent window

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...[color=blue]
> what does "stopped" mean?? do you get an error message? what exactly is[/color]
the[color=blue]
> problem?
>
> "J P Singh" <noemail@asIhatespam> wrote in message
> news:%23gbFb$86DHA.1816@TK2MSFTNGP12.phx.gbl...[color=green]
> > 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[/color]
> windows[color=green]
> > to allow them to add the data. The user adds the data and click save.[/color][/color]
The[color=blue][color=green]
> > pop window closes and refreshs the parent window to allow the entered[/color][/color]
data[color=blue][color=green]
> > 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[/color]
> let[color=green]
> > 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[/color][/color]
expenseDetails[color=blue][color=green]
> > 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
> >
> >[/color]
>
>[/color]


  #4  
Old July 19th, 2005, 11:49 AM
Howard Rothenburg
Guest
 
Posts: n/a
Default Re: Close pop window and refresh the parent window

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>...[color=blue]
> 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...[color=green]
> > what does "stopped" mean?? do you get an error message? what exactly is[/color]
> the[color=green]
> > problem?
> >
> > "J P Singh" <noemail@asIhatespam> wrote in message
> > news:%23gbFb$86DHA.1816@TK2MSFTNGP12.phx.gbl...[color=darkred]
> > > 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[/color][/color]
> windows[color=green][color=darkred]
> > > to allow them to add the data. The user adds the data and click save.[/color][/color]
> The[color=green][color=darkred]
> > > pop window closes and refreshs the parent window to allow the entered[/color][/color]
> data[color=green][color=darkred]
> > > 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[/color][/color]
> let[color=green][color=darkred]
> > > 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[/color][/color]
> expenseDetails[color=green][color=darkred]
> > > 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
> > >
> > >[/color]
> >
> >[/color][/color]
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles