var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Refresh causes double submit (post)
If user refreshes the browser window, or if user clicks twice onto the submit button, SQL query is executed twice, the table gets two new rows.
I found many possible solutions, but not the complete one - every solution has it's problems.
Any good idea about how to solve the problem?
No clue, need to no more about what you're doing now.
It's the issue that happened very often at Guestbooks and Forums.
If user clicks Submit (Post) button twice (double click), or refreshes the window (waiting for the response), there will be double entry in the database (two records, same content).
How to avoid the problem? Any idea?
That's what the USER is doing. What are YOU doing when they click a button? Submission forms aren't powered by pixie dust and coffee. They need to be implemented
What does seem to be the problem?
The ASP code was already made. I am just trying to recreate it to work without any problem. Anybody has idea about the solution? Anybody experienced double submit by clicking the button twice or by refreshing the window?
I think the problem is you don't know how that code works, and we can't help you if you can't describe what the code does.
ProTip: "It submits things" is not a valid answer.
Originally Posted by
I have experienced this same problem once.
The first page contain -
A textfield and a button in form tag.
<form name="form1" method="post" action="regionupdate.asp">
<input type="text" name="textfield" value="">
<input type="submit" name="Submit" value="Submit" onclick="<% SESSION("update_ok")=true%>">
If a user after coming back to the first, presses the refresh button the previous data is sent to the server.
I am not writing the whole code here just few lines...
conn.Execute "INSERT INTO REGION(r_code,r_name) VALUES ('" & strcode & "','" & trim(Request.Form("textfield")) & "')"
I hope to hear more solutions to this problem.
writing it at the head tag of the first page.
Success is the ability to go from one failure to another with no loss of enthusiasm.
- Sir Winston Churchill
Anoterh way to do it would be to use 3 pages.
page1.asp has the form which sends the data to page2.asp, a purely asp page which insert the record and sent redirect to page3.asp to thank the user, if page 3 if refreshed it doesnt' actully do any thing, if the browser back is used you need to block that by adding a script to page 1:
Hope this helps
Set the smart navigation property to true