How to Reload a Form without Getting Warning Dialog

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve

    How to Reload a Form without Getting Warning Dialog

    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?
  • Nel

    #2
    Re: How to Reload a Form without Getting Warning Dialog


    "Steve" <zacware@mac.co m> wrote in message
    news:139759bb.0 408220526.da7f2 25@posting.goog le.com...[color=blue]
    > 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?[/color]

    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("Locatio n: 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.


    Comment

    • Steve

      #3
      Re: How to Reload a Form without Getting Warning Dialog

      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" <nelly@ne14.co. NOSPAMuk> wrote in message news:<4128be73$ 0$78369$ed2619e c@ptn-nntp-reader01.plus.n et>...[color=blue]
      > "Steve" <zacware@mac.co m> wrote in message
      > news:139759bb.0 408220526.da7f2 25@posting.goog le.com...[color=green]
      > > 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?[/color]
      >
      > 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("Locatio n: 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.[/color]

      Comment

      Working...