By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,404 Members | 1,987 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,404 IT Pros & Developers. It's quick & easy.

Clearing values from variable when form proccesses ??

P: n/a
Ok, I have a form that on clicking of the Update button first updates
the specific record in the db, then Inserts if the vMemo field is not
empty. The problem that I'm having is that After updating if you hit
the [F5] key (refresh) it inserts another record ...
I have tried:
1. Clearing the vMemo field after the insert is done (vMemo = "")
2. Setting the value on the form for this field to ""

Neither of these are working. It's not displaying it on the screen
but it is holding it in memory (I guess). Any way to clear this out
after update/insert????
Thanks for any suggestions!!
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Change your page logic:

form.htm: posts to page.asp
page.asp: Processes form submission and has NO html. Redirects to
thanks.htm
thanks.htm: <html>Your record was inserted</html>

Ray at work

"Robin" <rd***@hotmail.com> wrote in message
news:d7**************************@posting.google.c om...
Ok, I have a form that on clicking of the Update button first updates
the specific record in the db, then Inserts if the vMemo field is not
empty. The problem that I'm having is that After updating if you hit
the [F5] key (refresh) it inserts another record ...
I have tried:
1. Clearing the vMemo field after the insert is done (vMemo = "")
2. Setting the value on the form for this field to ""

Neither of these are working. It's not displaying it on the screen
but it is holding it in memory (I guess). Any way to clear this out
after update/insert????
Thanks for any suggestions!!

Jul 19 '05 #2

P: n/a
Ray at <%=sLocation%> wrote:
Change your page logic:

form.htm: posts to page.asp
page.asp: Processes form submission and has NO html. Redirects to
thanks.htm
thanks.htm: <html>Your record was inserted</html>
Ok, I have a form that on clicking of the Update button first updates
the specific record in the db, then Inserts if the vMemo field is not
empty. The problem that I'm having is that After updating if you hit
the [F5] key (refresh) it inserts another record ...
I have tried:
1. Clearing the vMemo field after the insert is done (vMemo = "")
2. Setting the value on the form for this field to ""

Neither of these are working. It's not displaying it on the screen
but it is holding it in memory (I guess). Any way to clear this out
after update/insert????
Thanks for any suggestions!!


I think you can avoid creating the "thanks.htm" page by using this
technology:

1. User is on the page "form.asp"
2. He fills the form and sends it
3. System checks if "vMemo" is not empty
4. If it is not empty - inserts value
5. System calls
Response.Redirect( "form.asp?updated=yes" )
6. Else (if "vMemo" is empty) System checks if Reqest("updated")="yes"
7. If it equals, show the thanking message
8. Show the form and whole page if needed

If user presses f5 at this time, he will recieve again the thanking
message, but nothing will be inserted into database again.

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.