Re: preventing duplicate data entry on RELOAD

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Hans Kesting (news.2.hansdk_at_spamgourmet.com)
Date: 12/06/04


Date: Mon, 6 Dec 2004 15:55:15 +0100

Darrel wrote:
>> I'm not sure of your situation.
>
> I have a page with two panels. One panel is the form. One panel is the
> 'success' confirmation.
>
> On completion of a succesful submit, I hid the form panel and show the
> success panel.
>
> When a person reloads the page, though, it resubmits the data. I was
> confused because the data is only submitted via the button_click
> function...not the page_load function.
>

"reload" means "execute the same action that originally gave you this page",
so the browser will act (submit the form) as if that button was pressed,
using the values that were previously on the form. So a resubmit of the
same data is correct (though unwanted :-) ) behaviour.

> However, I think simply adding a flag on submit is the way to
> go...but yea, it looks like a roundtrip to the server.
>

But: it will use the *previous* values!

> I suppose redirectly to another page is perhaps a better idea.
> However, I have dozens of these submit/confirm combo pages so that
> may have to get put off and added to the bottom of the to-do list.
>
> -Darrel



Relevant Pages