473,395 Members | 1,527 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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
Jul 19 '05 #1
3 5132
what does "stopped" mean?? do you get an error message? what exactly is the
problem?

"J P Singh" <noemail@asIhatespam> wrote in message
news:%2****************@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

Jul 19 '05 #2
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" <ag*****@hsfinancial.co.uk> wrote in message
news:bv*************@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:%2****************@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


Jul 19 '05 #3
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:<eg**************@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" <ag*****@hsfinancial.co.uk> wrote in message
news:bv*************@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:%2****************@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


Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Winfried Koenig | last post by:
Hi everyone, I have a main page: -------------------------------------------------- <html><head><title>Test</title> </head><body> <img id="img_a" name="img_a" src="image_1.png" alt=""><br>
4
by: Andrew Alger | last post by:
ok i have two forms. Customer.aspx and Parent_Searh.aspx. There is a button on Customer.aspx that when executed runs javascript code to open up parent_search as a popup. After the user searches...
1
by: Targa | last post by:
After I submit a form from a popup window, I use the following code to close the popup and refresh the parent window. <a href="#" onclick="window.opener.location.reload();self.close();return...
3
by: MEM | last post by:
Hello, I'd like to refresh the main or top most browser window from a child window. Specifically, child popup A is opened by a main browser window then child popup B is opened from within child...
1
by: Marshall Dudley | last post by:
I have an application where in a shopping cart checkout a popup appears which suggests other items that may go with what was ordered with a button to add these items to the cart. When the button...
2
by: Simon Storr | last post by:
Is it possible to make the parent window refresh when a modal dialog is closed? I know I can use window.opener.location.reload(true); for a 'normal' window, but this doesn't work for...
5
by: Mardy | last post by:
Hello I'm trying to use a pop-up to capture some information and then return the user to a datagrid containing the changes made in the pop-up. I have the database update working and the pop-up...
1
by: Jake Barnes | last post by:
I've a button that onclick calls a function that calls the following code. The last 3 lines are for IE, which didn't want to close till I put in the funny line with opener. ...
1
by: mahesr | last post by:
Hi, Any one say, How to close a window (it's opened by click event,ie window.open) when we redirect to parent. am opened a child window in parent through click event.after processing that page...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.