473,385 Members | 1,341 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Stopping Repeated Form Submission

KV
I need to stop the user from getting the following message:

"The page cannot be refreshed without resending the information.
Click Retry to send the information again,
or click Cancel to return to the page that you were trying to view."

OR, I need to stop the form button from being activated again and again.

In my situation, I have a form with labels, text boxes, and a datagrid.
Every time I add something to the text boxes and click on the button, the
database is updated and the datagrid is refreshed. If the form is refreshed
and I click on "retry", then the database gets updated again with the same
information from the text boxes (as if I clicked the button). This is
undesirable, since I'm getting many duplicate records.

I added a "if not ispostback" statement and it takes care of the problem.
But now my datagrid doesn't display right, because I need those records
added to the database once whenever the form is submitted. So now I'm
caught in between a rock and a hard place. If I keep the logic in I get
dups, if I limit it then the datagrid never gets updated until the page is
manually refreshed.

Any ideas?

-Kevin
Nov 18 '05 #1
2 1081
you should add a transaction guid to every page, and log if its been
processed, this way you can ignore double postbacks, but the user can
resubmit if the transaction failed (deadlock), or was lost in the internet,
or IE failed to post correctly.

-- bruce (sqlwork.com)
"KV" <na*****@yahoo.com> wrote in message
news:10*************@corp.supernews.com...
I need to stop the user from getting the following message:

"The page cannot be refreshed without resending the information.
Click Retry to send the information again,
or click Cancel to return to the page that you were trying to view."

OR, I need to stop the form button from being activated again and again.

In my situation, I have a form with labels, text boxes, and a datagrid.
Every time I add something to the text boxes and click on the button, the
database is updated and the datagrid is refreshed. If the form is refreshed and I click on "retry", then the database gets updated again with the same
information from the text boxes (as if I clicked the button). This is
undesirable, since I'm getting many duplicate records.

I added a "if not ispostback" statement and it takes care of the problem.
But now my datagrid doesn't display right, because I need those records
added to the database once whenever the form is submitted. So now I'm
caught in between a rock and a hard place. If I keep the logic in I get
dups, if I limit it then the datagrid never gets updated until the page is
manually refreshed.

Any ideas?

-Kevin

Nov 18 '05 #2
KV
Thanks for the pointer. I did a search for "transaction guide" (looking for
code samples) but didn't come up with anything. What's the easiest way to
implement a transaction guide?

-Kevin
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Tom | last post by:
I have created the following code for a product select/payment form (don't know if there is a better way) and I have been trying to make the following changes (unsuccessfully so far): 1) ...
19
by: Pete | last post by:
I have form/select which executes a function using onchange. No problem. However, when I validate the page with a strict HTML 4.01 doctype at http://validator.w3.org, it demands either an action or...
10
by: Andres Eduardo Hernando | last post by:
Hi, I'm not entirely sure this is the right group to ask this question, but I saw a similar one above, and the group's charter is not clear enough about it, so, here I go: ;) What is the...
2
by: Andy Goldstein | last post by:
I have a table where all the TRs have an onClick handler registered. One (and only one) of the rows has 2 text input boxes, where each textbox has an onChange handler registered. Both the onClick...
8
by: yawnmoth | last post by:
Say I have the following HTML: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> </head> <body> <form action="">
6
by: Oleg Konovalov | last post by:
Hi, I have a Java/JavaScript GUI application where I perform a lot of long DB operations , which takes 5-60 secs to perform. Sometimes user double-clicks the button or just gets impatient and...
3
ashsa
by: ashsa | last post by:
Hi all Am trying to validate a form onsubmit. And all the validation functions are working fine. I have assigned different type of validation functions to be called on clicking each input...
1
by: Homer | last post by:
Hi, I just got a requirement from my HR department to automate their form submission process and integrate it into the Intranet project that I had just completed Phase 1 of. Because of the...
8
Megalog
by: Megalog | last post by:
Hey guys.. my turn to ask a question: I'm having a weird issue with a form I've reworked. This form has a combo box, which when used is changing the recordsource of a subform. This subform has...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.