Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Back/Refresh Button Issues

Status
Not open for further replies.

teblack

Programmer
Apr 30, 2004
45
We are working on a large project that has many data entry pages and we are having problems with the users using the back button which is causing our insert and update routines to re-fire, thus causing duplicate entries in our database. This also occurs when they press the fresh button from a confirmation page within the site.

We are looking at disabling the both buttons but wanted to know if there might be a better solution out there that someone has come up with. We understand that taking these buttons away that it might cause some user flustration, but not sure what else we can do about.

Any and all advice or help with this issue would be greatly appreciated.

Thanks again

TBlack -
 

A better solution would be to detect the duplication server-side, and ignore it.

You might also consider forwarding (server-side) to a new page after receiving a post-based form submission. That would stop the "do you want to repost..." message.

Hope this helps,
Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Definitely go with what Dan told you. Don't limit the user, make the script be prepared for the user's actions. If you ensure server-side that data will not be inserted into the database twice, you will protect yourself from all user input. If you disable buttons (only available through client-side scripting), there are still users out there that can turn it off. Plus, users who will hate your site because it takes away part of their expected functionality. Always code so that you don't irritate the user.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top