Log in

View Full Version : AVOID multiple form submittals via "back button"



deltatango5
02-14-2008, 10:29 PM
I know there really isn't a way to disable the "back button" on the browser BUT ... I'm trying to not allow multiple entries via a form submit when the back button is depressed on the browser.

Basically is there a code snippet that somebody can provide so that when a form is submitted and somebody attempts to go back by hitting the "back" button, that form information just entered won't resubmit into the database?

Any assistance you provide is greatly appreciated!!!

Thanks Much,
Des

rangana
02-15-2008, 12:00 AM
YOu could just create a query and make matches in the database....if the inputs already exist in the databse....then don't let it be saved.

I would love to code it for you...but when I see it..It's in ASP...I don't know anything about it..i'm more on PHP :D

but I guess...same thing applied...:D

dsagrera
02-24-2008, 12:59 PM
Try saving a session cookie on the INSERT asp page:


If Session("already_inserted") = "" then
SQL = "..."
Session("already_inserted") = "Y"
Response.Redirect "..."
Else
Response.Write "You already submitted the form"
End IfSo, If the session cookie has already been created, it won't let the user pass the information again to the database, at least for several minutes. If you want something more permanent, use cookies with the ".Expires" value and not Session cookies. Regards!