By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,827 Members | 2,140 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,827 IT Pros & Developers. It's quick & easy.

How to Reload a Form without Getting Warning Dialog

P: n/a
I'm working in PHP, but am also using JavaScript, so perhaps there is
a better way to do this using more PHP code......

I setup a search screen for my database, the user enters data and
submits a form via POST

From that I get a results list screen, based on data I submit via a
form from the search screen

In the results list screen, I have a button next to each record for
editing

When clicked, a new window is spawned, letting the user enter the
record

When the user clicks save, the data is saved, and the resulting
"success" response page then issues a "reload" javascript statement to
the parent window (which is the search resulsts window), to refresh it
to update the list of found results since once of them has just been
edited.

In mozilla, this works if the parent window was generated via GET, but
in this case, the parent window was generated via POST, so I get a
warning like:

"The page you are trying to view contains POSTDATA. If you resend the
data, any action the form carried out will be repeated...."

Which is annoying, and confusing to users for my purposes.

Is there some other way I can accomplish this "reload" function of the
parent window when working with POST data without getting this dialog?

The only method I can think if is to get the base URL, and then parse
the submited FORM data into a URL string so I essentially turn the
POST DATA into a GET URL string. This would seem to be a bit of work
for every form on my site that uses this functionality, so I was
hoping I was missing a more obvious solution?
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Nel

"Steve" <za*****@mac.com> wrote in message
news:13*************************@posting.google.co m...
I'm working in PHP, but am also using JavaScript, so perhaps there is
a better way to do this using more PHP code......

I setup a search screen for my database, the user enters data and
submits a form via POST

From that I get a results list screen, based on data I submit via a
form from the search screen

In the results list screen, I have a button next to each record for
editing

When clicked, a new window is spawned, letting the user enter the
record

When the user clicks save, the data is saved, and the resulting
"success" response page then issues a "reload" javascript statement to
the parent window (which is the search resulsts window), to refresh it
to update the list of found results since once of them has just been
edited.

In mozilla, this works if the parent window was generated via GET, but
in this case, the parent window was generated via POST, so I get a
warning like:

"The page you are trying to view contains POSTDATA. If you resend the
data, any action the form carried out will be repeated...."

Which is annoying, and confusing to users for my purposes.

Is there some other way I can accomplish this "reload" function of the
parent window when working with POST data without getting this dialog?

The only method I can think if is to get the base URL, and then parse
the submited FORM data into a URL string so I essentially turn the
POST DATA into a GET URL string. This would seem to be a bit of work
for every form on my site that uses this functionality, so I was
hoping I was missing a more obvious solution?


Not sure if this is the best idea, but one solution could be to process the
POST data in a php script, assign the variables to a session, validate the
variables and then user header("Location: nextpage.php") to move the user to
a page that is not processing POST data. Therefore, when refreshed it will
not ask to resubmit the data?

Nel.
Jul 17 '05 #2

P: n/a
I finally got something to work...what I did was that I put some code
in to convert the POST data to GET data and reload the form that way
via JavaScript. At first I thought it would be messy, but once I got
into it, the solution turned out to be fairly elegant. At least for a
newbie like me!

"Nel" <ne***@ne14.co.NOSPAMuk> wrote in message news:<41***********************@ptn-nntp-reader01.plus.net>...
"Steve" <za*****@mac.com> wrote in message
news:13*************************@posting.google.co m...
I'm working in PHP, but am also using JavaScript, so perhaps there is
a better way to do this using more PHP code......

I setup a search screen for my database, the user enters data and
submits a form via POST

From that I get a results list screen, based on data I submit via a
form from the search screen

In the results list screen, I have a button next to each record for
editing

When clicked, a new window is spawned, letting the user enter the
record

When the user clicks save, the data is saved, and the resulting
"success" response page then issues a "reload" javascript statement to
the parent window (which is the search resulsts window), to refresh it
to update the list of found results since once of them has just been
edited.

In mozilla, this works if the parent window was generated via GET, but
in this case, the parent window was generated via POST, so I get a
warning like:

"The page you are trying to view contains POSTDATA. If you resend the
data, any action the form carried out will be repeated...."

Which is annoying, and confusing to users for my purposes.

Is there some other way I can accomplish this "reload" function of the
parent window when working with POST data without getting this dialog?

The only method I can think if is to get the base URL, and then parse
the submited FORM data into a URL string so I essentially turn the
POST DATA into a GET URL string. This would seem to be a bit of work
for every form on my site that uses this functionality, so I was
hoping I was missing a more obvious solution?


Not sure if this is the best idea, but one solution could be to process the
POST data in a php script, assign the variables to a session, validate the
variables and then user header("Location: nextpage.php") to move the user to
a page that is not processing POST data. Therefore, when refreshed it will
not ask to resubmit the data?

Nel.

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.