[thelist] location.reload() question

Dan Slater DSlater at buxtonco.com
Tue Sep 19 13:24:09 CDT 2000


Hello,

I'm trying to "force" a refresh of the "opener" window - after a user has
finished adding a record to a popup window.  The user can click on an "Add
Contact" button if the Contact is not present in the <select> tag that
generates a list of availabe contacts.  When clicked - a pop up window is
created that opens a pre-existing "Add Contact" form.  When the user clicks
the "Save" button on the popup window - I need to "refresh" the contents of
the <select> on the page that called the popup.

Here's the function that accomplishes this:

<script language="JavaScript">
  if (window.name == "ContactWindow")
    {
    window.opener.location.reload()
    window.close()
    }
else	{
	window.location.href = "../index.cfm"
	};
</script>

This works great except for one thing.  Since the page being refreshed gets
it's data from several queries - the reload() method results in this prompt
to the user:

	The page cannot be refreshed without resending the information.
	Click Retry to send the information again,
	or click Cancel to return to the page you were trying to view.

Another unwelcome side effect of this is that the user may have already
entered data onto other fields on the page, and the refresh will wipe the
fields clean.

Is there a way to turn off the above prompt via JavaScript?  I believe that
I can store what data the user may have already entered onto the page in JS
variables and then use those variables to restore values to the fields after
the refresh.

It's too bad i can't simply "refresh" the contents of the single <select> in
question.  Or is there a way to do this, and i'm just not aware of it?

Respectfully,

Dan Slater




More information about the thelist mailing list