Redirect_to still allow a form to be submitted

Hello all,

Possibly a simple one - I have a form and an action and then afterwards a redirect_to. When the user submits the form, the data is stored and then the user is redirected to another page. If the user then refreshes the page they have been redirected to, they are then prompted to resubmit the form. Can anyone suggest why this is occurring and how to stop it occurring!

Thanks,

Alastair

Hi Alastair,

Alastair Moore wrote:

If the user then refreshes the page they have been
redirected to, they are then prompted to resubmit
the form.

What do you mean "prompted to resubmit the form" exactly? Are they taken back to the page with the form on it?

Thanks,
Bill

Bill,

If I was to submit a form on a site and then click back, the browser
(certainly firefox and camino on the Mac) will often prompt you to
submit the form. It's doing that. It doesn't show the form again,
simply on refreshing it's as it the page I've been passed to was the
page that the original form was submitted to rather than redirected to
after the form has been processed. This means, for example, a user-sign
up form, the user enters their data and then is redirected to a new
page after the form has been submitted. If the user then refreshes the
page, they are prompted to save their form data again and a new record
is stored (or attempted to be stored) in the DB . I will try and put an
example up if I'm not being clear :slight_smile:

Cheers,

Alastair

Alastair wrote:

If I was to submit a form on a site and then
click back, the browser (certainly firefox and
camino on the Mac) will often prompt you to
submit the form.

The behavior that comes to mind from your description is where a dialog pops up saying something like "the page contains POST data and will be resubmitted if you continue." Is that what you're talking about?

If the user then refreshes the page, <snip> a new record
is stored (or attempted to be stored) in the DB .

Are you sure about the new record being created?

I will try and put an
example up if I'm not being clear :slight_smile:

That'll probably help :wink:

Best regards,
Bill